Solved

Javac help

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Checkbox and ListView in Android Layout 4 65
diffSum example 4 36
Error in @AspectJ Based AOP with Spring 2 13
runtime exception 2 27
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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 …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

808 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