Solved

Javac help

Posted on 2003-10-22
5
438 Views
Last Modified: 2013-11-23
Hello all,
I am trying to compile a java program (print.java).  This program exists on our system now but I need to change it.  However I am having issues with the compile.  I assume I am missing some JAR files or something.  Can someone please point me in the right direction?  Thanks!!!
Here is what I get when I try to compile:
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

P:\>javac c:\j2sdk1.4.2_01\lib\evix\print.java -deprecation
c:\j2sdk1.4.2_01\lib\evix\print.java:12: cannot resolve symbol
symbol  : class AS400Pool
location: class print
     public static AS400Pool pool = new AS400Pool();  // Delcare the connection
pool class.
                   ^
c:\j2sdk1.4.2_01\lib\evix\print.java:13: cannot resolve symbol
symbol  : class AS400ConnectionPool
location: class print
     public static AS400ConnectionPool conPool = new AS400ConnectionPool();
                   ^
c:\j2sdk1.4.2_01\lib\evix\print.java:12: cannot resolve symbol
symbol  : class AS400Pool
location: class print
     public static AS400Pool pool = new AS400Pool();  // Delcare the connection
pool class.
                                        ^
c:\j2sdk1.4.2_01\lib\evix\print.java:13: cannot resolve symbol
symbol  : class AS400ConnectionPool
location: class print
     public static AS400ConnectionPool conPool = new AS400ConnectionPool();
                                                     ^
c:\j2sdk1.4.2_01\lib\evix\print.java:44: cannot resolve symbol
symbol  : class dateFormatter
location: class print
                   dateFormatter df = new dateFormatter();
                   ^
c:\j2sdk1.4.2_01\lib\evix\print.java:44: cannot resolve symbol
symbol  : class dateFormatter
location: class print
                   dateFormatter df = new dateFormatter();
                                          ^
c:\j2sdk1.4.2_01\lib\evix\print.java:47: warning: getValue(java.lang.String) in
javax.servlet.http.HttpSession has been deprecated
                   int[] sessionID = (int[])session.getValue("SessID");
                                                   ^
c:\j2sdk1.4.2_01\lib\evix\print.java:48: warning: getValue(java.lang.String) in
javax.servlet.http.HttpSession has been deprecated
                   String[] vendor = (String[])session.getValue("Ven");
                                                      ^
c:\j2sdk1.4.2_01\lib\evix\print.java:49: warning: getValue(java.lang.String) in
javax.servlet.http.HttpSession has been deprecated
                   String[] username = (String[])session.getValue("User");
                                                        ^
6 errors
3 warnings

I'm fairly new to java so this may be something stupid I'm overlooking. Thanks!
0
Comment
Question by:NARoberts
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:savalou
Comment Utility
Are you importing these classes?  Something at the beginning of your Print.java file like:

import com.something.AS400ConnectionPool;

Is dateFormatter supposed to be the the class from the Swing packages?  It's spelled with a capital D, DateFormatter.  In that case you need:
import javax.swing.text.DateFormatter;
0
 
LVL 3

Author Comment

by:NARoberts
Comment Utility
Here are the imports and the first line:
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import lotus.domino.*;
import com.ibm.as400.access.*;
import java.text.*;
 
public class print extends HttpServlet {

This code should all compile as is.  I am taking current source that was left by another programmer and just recompiling it.
0
 
LVL 3

Author Comment

by:NARoberts
Comment Utility
I just noticed I have class files called "AS400ConnectionPool" and "dateFormatter" in the same folder as this print.java I am trying to compile.  Could it be something with javac not being able to find these classes?  I have a path statment to that folder?
0
 
LVL 3

Accepted Solution

by:
savalou earned 50 total points
Comment Utility
Maybe.  You can give javac a -classpath path1;path2 argument.  If you are compiling from within the directory containing print.java, this would be
-classpath .
that's a dot :)
0
 
LVL 3

Author Comment

by:NARoberts
Comment Utility
I think you got me on the right track.  I compiled it with:

 C:\>javac -classpath "c:\j2sdk1.4.2_01\lib\evix" c:\j2sdk1.4.2_01\lib\evix\print.java -deprecation

And I get a whole new set of errors.  Looks like I need to work on my environment some.  Thanks for the help!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now