aspose file tools*
The moose likes Java in General and the fly likes Running Java 1.4 compiled code using 1.5 JVM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Running Java 1.4 compiled code using 1.5 JVM" Watch "Running Java 1.4 compiled code using 1.5 JVM" New topic
Author

Running Java 1.4 compiled code using 1.5 JVM

Michael Mathewson
Greenhorn

Joined: Feb 22, 2002
Posts: 7
Is there any known repercussions to running Java 1.4 compiled apps under a 1.5 JVM (altering the JNLP to use 1.5)? We have run into an issue with clients running our 1.4 apps while using Windows 7 64 bit machines, the issue being it doesn't work. It does work with Java 5 32-bit JRE installed on the Windows 7 machine. Any thoughts would be greatly appreciated.

Thanks,
Michael
Jayr Motta
Ranch Hand

Joined: Jul 30, 2010
Posts: 110

Maybe there are some JVM incompatibility with anothers architectures like from 32bits for 64bits, i don't know. But you could try search for flag configs to JVM to run it as 1.4 java code and maybe some flag to convert 32-64bits or something like that.


Feel free to ask me anything!
www.BlackBeltFactory.com/ui#!/ref=jmotta, SCJP 6, OCWCD JEE5, OCE EJB JEE6
Jayr Motta
Ranch Hand

Joined: Jul 30, 2010
Posts: 110

According to this discussion on StackOverFlow: http://stackoverflow.com/questions/783662/java-32-bit-vs-64-bit-compatibility there is no such thing as incompatibility between .class/source in 32bits and 64bits, but there is certainly while running code on different versions.

Even so, i don't believe it could not work once "Write once, run everywhere" is what mess/bless us, what happens when you try to run the program? Try to execute this from the DOS and see what is returned, like an error or something like that!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

Michael Mathewson wrote:the issue being it doesn't work.

ItDoesntWorkIsUseless. What error are you getting, or what is it doing other than expected?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14144
    
  18

You should be able to run Java 1.4 compiled apps on Java 5 without changing anything. Sun (and now Oracle) have always been very, very careful to make sure that newer Java versions are backwards compatible with older versions.

However, there are a number of possible situations where you will have to change something in your code. The following document describes these in detail: Incompatibilities in J2SE 5.0 (since 1.4.2)

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Sunny Bhandari
Ranch Hand

Joined: Dec 06, 2010
Posts: 448

Many times I have faced the issue of version of a particular API class being not what is supposed to be when running programs on newer JDK


Java Experience
Michael Mathewson
Greenhorn

Joined: Feb 22, 2002
Posts: 7
Thanks for the responses guys... the thing to mention i guess is the highest public version of Java 1.4.2 is Update 19, and this is not supported under Windows 7... not till Update 23 and that gets you into Java For Business which isn't free and is very costly... hence attempting to run our 1.4 apps under the 1.5 JVM.

http://www.oracle.com/technetwork/java/javase/system-configurations-139862.html

Under Update Release Footnotes see ...

Windows 7 support was introduced in 1.4.2_23.


Rob Spoor said "ItDoesntWorkIsUseless. What error are you getting, or what is it doing other than expected?" >>> i mean it does not work, nothing happens... this was with trying 1.4.2_19

On another note, we have been testing one of our simpler applications (reporting) and everything seems to be working as normal... the next will be our billing app which has more depth to it... my main concern was if anyone knew of any specific things that would not work by running this way.

Once again, thanks for everyone's time... much appreciated.


Michael
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14144
    
  18

If you decide to upgrade to a newer version of Java, then I'd strongly recommend that you use Java 6, not Java 5 - because Java 5 is also very old and has been in the end-of-life status since October 2009 (see this page for more information).

Java 6 contains lots of improvements, not only in functionality but also in performance, compared to Java 5.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running Java 1.4 compiled code using 1.5 JVM