| Author |
Probelms with JDK 1.4 compiling with packages
|
Bob Backlund
Ranch Hand
Joined: Jun 05, 2003
Posts: 51
|
|
Hi I was wondering if someone could help me out. I have just written a quite simple java system which consists of about 12 classes under 5 packages (folders). Now if I compile this in JDK 1.5 (which it was quite natural to choose the latest JDK) eveything is fine, all the classes compile, no problem. BUT... IBM WAS 5.0 can't handle WebApps compiled using JDK1.5, so I had to download the previous version, JDK1.4 (j2sdk1.4.2_07 to be precise). The problem is now when I go to compile the same classes in the same folder structure, I get loads of error like: uk\co\domain\servlets\SoftwareUpdateServlet.java:10: package uk.co.domain.database does not exist import uk.co.domain.database.DBConnectionPool; This happens for every import of every class I have, but like I say. Compile it in JDK1.5.0 and it's fine. Anyone know of any problems with 1.4 and packages? Cheers
|
Cheers!
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24041
|
|
|
Nope. There are no changes, bugs, or issues regarding packages. In installing JDK 1.4, you may have set or changed the CLASSPATH environment variable so that the compiler is not finding your source. Show us its value, and also show us the command line you're using to compile, amd we'll probably be able to tell you where you've gone wrong.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Bob Backlund
Ranch Hand
Joined: Jun 05, 2003
Posts: 51
|
|
D:\Development\Dev\web\WEB-INF\classes\uk\co\domain in folders called: beans controllers database servlets utils Source code is under: D:\Development\Dev\src\uk\co\domain is same fodler names as above
|
 |
Bob Backlund
Ranch Hand
Joined: Jun 05, 2003
Posts: 51
|
|
Classes are saved under the following: D:\Development\Dev\web\WEB-INF\classes\uk\co\domain in folders called: beans controllers database servlets utils Source code is under: D:\Development\Dev\src\uk\co\domain is same fodler names as above My compiler batch file is as follows: CD\Development\Dev\src JAVAC -d D:\Development\Dev\web\WEB-INF\classes uk\co\domain\beans\*.java JAVAC -d D:\Development\Dev\web\WEB-INF\classes uk\co\domain\controllers\*.java JAVAC -d D:\Development\Dev\web\WEB-INF\classes uk\co\domain\database\*.java JAVAC -d D:\Development\Dev\web\WEB-INF\classes uk\co\domain\servlets\*.java JAVAC -d D:\Development\Dev\web\WEB-INF\classes uk\co\domain\utils\*.java My config file as follows: SET JAVA_HOME=C:\Java\j2sdk1.4.2_07 SET JAVA_BIN=C:\Java\j2sdk1.4.2_07\bin SET JAVA_JRE=C:\Java\j2sdk1.4.2_07\jre SET DEV_LIBS=D:\Development\Dev\web\WEB-INF\lib\ SET PATH=%PATH%;%JAVA_HOME%;%JAVA_JRE%;%JAVA_BIN% SET CLASSPATH=%CLASSPATH%;%JAVA_LIBS%;%DEV_LIBS%\servlet.jar
|
 |
Bob Backlund
Ranch Hand
Joined: Jun 05, 2003
Posts: 51
|
|
Here is an exampe of the errors I am getrting: D:\Development\Dev\src>JAVAC -d D:\Development\Dev\classes uk\co\domain\beans\*.java D:\Development\Dev\src>JAVAC -d D:\Development\Dev\classes uk\co\domain\controllers\*.java uk\co\domain\controllers\FunctionController.java:8: package uk.co.domain.beans does not exist import uk.co.domain.beans.UserDataBean; ^ As you can see the bean package (which had no imports) copiles fine, but the controllers package does not, claiming that "package uk.co.domain.beans does not exist" which is funny as it's just compiled that package. As I say I do not get this if I compile the code using JDK1.5, but because of WAS 5.0 I have rto use JDK1.4 or below.
|
 |
 |
|
|
subject: Probelms with JDK 1.4 compiling with packages
|
|
|