aspose file tools
The moose likes Java in General and the fly likes 1.4 Compiler - 1.3 JRE Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "1.4 Compiler - 1.3 JRE" Watch "1.4 Compiler - 1.3 JRE" New topic
Author

1.4 Compiler - 1.3 JRE

Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15229

If I write a program and compile it use the 1.4.1 compiler but I know that all the API's I used are the same as 1.3.x, is it safe to say that the application will run correctly on a 1.3.x JRE?
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
I would venture to say probably not. Even though the API spec hasn't changed, perhaps some minor change in the way the two versions create the byte codes in the class file could cause it to not run correctly, if at all. However, if you use a 1.3.x compiler, it should run on both 1.3.x and 1.4.x JREs.
Disclaimer: This is my (only slightly) educated guess. Hopefully someone else will chip in if I am too far off base.


Java API Documentation
The Java Tutorial
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
You can use a 1.4 compiler to create .class files which execute on 1.3 with the -target option:
javac -target1.3 MyClass.java
If your code uses any features that are only available in 1.4, you'll get an appropriate error message when you compile.


"I'm not back." - Bill Harding, Twister
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15229

What if you don't use the -target option. Any documentation on the difference in bytecode from one version to the other without reading the VM specs for each version and figureing it out? Did anyone just say "Here is the difference"?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: 1.4 Compiler - 1.3 JRE
 
Similar Threads
Did not understand the answer(John Meyers's mock exam)
WSAD 5.1.2 and J2SE 1.5 Compiler
.class and Compiler Version?
External entity not found:
Java Versions - i m worried !!!