| How can I do "javac -source 1.5 -target 1.1" in Eclipse 3.2 JDT? [message #232911] |
Tue, 18 July 2006 20:47  |
|
Originally posted by: benh.ibsglobalweb.com
Hi all,
As I understand it, the new Java 1.5 extensions can be compiled to run
on older VMs, using a compile command like "javac -source 1.5 -target 1.1".
However, its not clear how/if I can acheive the same thing using the JDT
compiler. When I tried, I received a message telling me my classfile
level must be equal or greater than source level.
This would this seem defeat the whole purpose of ensuring the Java 5.0
language changes were backwards-compatible at the classfile level, or
did I misunderstand it?
Regards
Ben Hutchison
|
|
|
| Re: How can I do "javac -source 1.5 -target 1.1" in Eclipse 3.2 JDT? [message #232919 is a reply to message #232911] |
Tue, 18 July 2006 22:07  |
Olivier Thomann Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Ben Hutchison a écrit :
> Hi all,
>
> As I understand it, the new Java 1.5 extensions can be compiled to run
> on older VMs, using a compile command like "javac -source 1.5 -target
> 1.1".
This should not work even with javac. The best you can do is to use the
jsr14 target with javac. But this doesn't handle all the 1.5 constructs
and you only get a 1.4 target.
> However, its not clear how/if I can acheive the same thing using the JDT
> compiler. When I tried, I received a message telling me my classfile
> level must be equal or greater than source level.
This is on purpose.
> This would this seem defeat the whole purpose of ensuring the Java 5.0
> language changes were backwards-compatible at the classfile level, or
> did I misunderstand it?
Why would you want to get backwarks-compatibility? This has never been
part of the contract even for 1.4 .class files.
The .class files are upwards-compatible.
Hope this clarify it.
--
Olivier
|
|
|
Powered by
FUDForum. Page generated in 0.01575 seconds