Skip to main content

Back/Forward Compatible Feature Request

2 replies [Last post]
blbrown
Offline
Joined: 2005-04-20

Maybe somebody has figured this one out besides me. And, I have been reading the compatibility issues between older VMs. But compiling the most basic code in Java5.0 won't work on other VMs. Am I wrong? I have tried the target flags and other things. But, I get that minor/major version error. This is mainly with Tomcat, so there maybe class loading issues that might allow for the 'target' flag. And, I read I can add version info to the MANIFEST files.

I guess I mainly need backward compatible. If the code is 1.3 code, if I compile with 1.5, it should work in a 1.3/1.4 runtime. Or unless I am doing something different, maybe it does?

What are your thoughts, I see this has been debated here before.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jwenting
Offline
Joined: 2003-12-02

Maybe you should read the compiler manual...

I compile everything with 1.5 now on Windows and then run it on 1.4 on Linux without any problems.

timbell
Offline
Joined: 2003-06-10

> I guess I mainly need backward compatible. If the
> code is 1.3 code, if I compile with 1.5, it should
> work in a 1.3/1.4 runtime. Or unless I am doing
> something different, maybe it does?

If you want to compile code using a javac that is newer
than the runtime that will be running the code, you need
to take special care. Quoting from the [b]javac[/b] man
page:
[i]It is important to use -bootclasspath and -extdirs when cross-compiling[/i]

For more information, take a look at this web page:
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javac.html

Search for the [b]Cross-Compilation Options[/b] section.