• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Probelms with JDK 1.4 compiling with packages

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bob Backlund
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic