Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java 1.4 to 1.1.8

Status
Not open for further replies.

dcusick

Technical User
Aug 9, 2000
271
US
What's up all? I've been coding java for a while, but first time I'm really getting into distributed apps outside of a set working environment. I wrote a very basic GUI app that runs a few SQL statements against a database with JDK 1.4. I am going to be distributing this app to a group of users who are using JRE 1.1.8. They do not want to update their JVM. So, I went out and go the necessary lib files for my app: swingall.jar, collections.jar, classes.zip, etc.... I run ant ant script against the java files and it builds the jar file fine for me. No problem compiling. However, when I try to run it, I keep getting the same error.

Class not found: org.ggg.fse.gui.MainDesktop.

I'm using jre.exe and calling org.ggg.fse.gui.MainDesktop as my class file. Examining my jar file, I can see that the class file is in there and is in the exact package I specified. If I run this with Java.exe in JVM 1.3 or 1.4, it runs fine. Is there something I'm missing since I'm running with JRE in JVM 1.1.8? BTW, I AM including the jar file in the command line arguement -cp, so I don't think it 's that... Any ideas?? Thanks a lot..

Doug
 
You should compile your applications using the same SDK version as your target JRE.

You may get away with compiling on 1.4 and running on 1.3, but 1.1 is just too old.
 
okay, maybe I wasn't clear with my wording. Sorry, I can never find the right words to describe my problems. I did compile with SDK 1.1.8. I downloaded the JDK 1.1.8 and when I ran Ant, I specified to use my 1.1.8 build. So I did compile using 1.1.8. The problems lies in when I try to run it using the JRE.exe command. Any ideas?

Doug
 
So have you imcluded your custom classes /jar file in the JRE's CLASSPATH ?
 
Yup, sure did... here's my the JRE command line as appears in my .bat file.


Code:
set DPR_JARS=%FILE_HOME%\lib\dpr.jar;%FILE_HOME%\lib\classes.zip;

jre.exe -v -nojit -ms32m -mx64m -classpath "%DPR_JARS%" org.ggg.fse.gui.MainDesktop > dpr_log.txt 2>> dpr_err.txt


Before this in the bat file, I set the Java_home directory to my JDK1.1.8. Also my FILE_HOME is the correct directory and dpr.jar is my custom jar file.
 
Here it is...

Code:
     0 Fri Jan 30 08:58:06 EST 2004 META-INF/
    55 Fri Jan 30 08:58:06 EST 2004 META-INF/MANIFEST.MF
     0 Fri Jan 30 08:58:06 EST 2004 org/
     0 Fri Jan 30 08:58:06 EST 2004 org/ggg/
     0 Fri Jan 30 08:58:06 EST 2004 org/ggg/fse/
     0 Fri Jan 30 08:58:06 EST 2004 org/ggg/fse/actions/
  1688 Fri Jan 30 08:58:06 EST 2004 org/ggg/fse/actions/MainAction.class
  6412 Fri Jan 30 08:58:06 EST 2004 org/ggg/fse/DupeFundRemoval.class
     0 Fri Jan 30 08:58:06 EST 2004 org/ggg/fse/gui/
  1461 Fri Jan 30 08:58:06 EST 2004 org/ggg/fse/gui/GridBagAdder.class
   580 Fri Jan 30 08:58:06 EST 2004 org/ggg/fse/gui/MainDesktop$1.class
  3949 Fri Jan 30 08:58:06 EST 2004 org/ggg/fse/gui/MainDesktop.class

Thanks for the help so far sedj
 
Well that looks OK.

Try -
- using your 1.1 java.exe to run the class

- instead of using the switch -classpath use -cp

 
well, the problem is, that the people I'm going to be distributing this app to do not have that... They have JVM 1.1.8, and they only have the jre.exe file, not java.exe. I need this to run with jre.exe. I've tried to get them to upgrade their JVM, but it's not working too well... Also, I tried -cp and -classpath... Neither one has worked...
 
yes, but didn't you say that on your development machine, you a 1.1 version ? Use that to test the java.exe (doing -version first to check you've got the right one). If you cannot compile and run the classes on a 1.1 version, then you should not be shipping "blind" as it were ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top