[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Javac help

Posted on 2003-10-22
5
Medium Priority
?
451 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
ID: 9599201
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
ID: 9599220
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
ID: 9599319
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 200 total points
ID: 9599581
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
ID: 9599996
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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 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