Solved

Javac help

Posted on 2003-10-22
5
444 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

733 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