Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can java 1.4 emulate 1.3 ?

 
Tom Hughes
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because I want to run 1.3 apps and 1.4 apps on the same machine (WinNT).
cheers,
Tom
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be able to run 1.3 classes under 1.4.
You MAY not be able to run 1.4 apps under 1.3 depending on what classes were used.
You CAN have both JRE's implemented on the same machine, and just switch the classpath etc when you execute the apps.
Make a .bat file and put your command to invoke the application in there. Include the classpath to the version of the JRE that you want as a parameter when you invoke the app.
Then just run the bat file.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two gotchas-->
1- if you're on Windows, you might have to mess around with your registry to switch between versions.
2- if your JDK 1.3 app uses a method called .assert() you'll have issues as this is a new key word in 1.4
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The assert thing is something that could cause a problem.
However, I believe if you explicitly name your classpath in your execution statement, that it overrides the classpath parameter in the Windows Registry.
This is a .bat file that we use to insure that the user in picking up the version of the JRE that we want:
myApp.bat
_______________________________________________
set E2_RUN_DIR=c:\E-Squared\
"c:\program files\javasoft\jre\1.3.1\bin\java" -classpath .;"c:\program files\javasoft\jre\1.3.1\lib\rt.jar";wleclient.jar;m3envobj.jar;jh.jar;evpa-live.jar;report11_pro.jar;report12_pro.jar;javaARM.jar -DWSS_DIR=%E2_RUN_DIR% com.myCompany.evpa.wss.Wss myApp.properties
------------------------------------------------
invoke the Wss.class file using the myApp.properties file as a parameter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic