Solved

Javac help

Posted on 2003-10-22
5
441 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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
get weblogic logged in user in java 2 59
MySqlDump not dumping triggers 1 19
eclipse apache tomcat admin console 52 73
use lov values 2 38
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

863 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

18 Experts available now in Live!

Get 1:1 Help Now