[concurrency-interest] Why not J2SE 5?

Osvaldo Pinali Doederlein osvaldo@visionnaire.com.br
Mon, 06 Dec 2004 14:17:33 -0300

David Holmes wrote:
> Osvaldo writes:
>>No it doesn't work.  This produces the following output:
>>"javac: source release 1.5 requires target release 1.5"
> Think about this a bit. You have to have compatible source and target
> options. If you want source 1.5 you must have target 1.5 ! But you can use
> source 1.4 and target 1.4 to produce a 1.4 version.

Then why two switches, sourge & target?  A single switch would do it.

Historically, in older JDKs we could always use -target with a lesser
version that -source.  That was useful because most previous language
enhancements didn't depend on new JVMs, e.g. inner classes.  Even the
strictfp feature could be easily compiled to old JVMs because in older
JVMs all maths was strict (so the new atribute would be redundant).
J2SE1.4 was first (with assert) to introduce language enhancements that
really required a new JVM.  And with 1.4, "-source 1.4 -target 1.3" is
supported and it makes a lot of sense (doesn't allow using "assert" as
an identifier, which is a good measure before you could move to 1.4).

> There is no magic way to use 1.5 language features and have them work on the
> 1.4 VM - which is not what the original poster was talking about anyway.
> They wanted to update their development environment to 1.5 while running the
> production on 1.4 and you CAN do that.

Sorry, you are right, I misunderstand that post.  It seems I jumped
on this due to my gripe with "-source 1.5/-target 1.4"


Osvaldo Pinali Doederlein                   Visionnaire Informática S/A
osvaldo@visionnaire.com.br                http://www.visionnaire.com.br
Arquiteto de Tecnologia                          +55 (41) 337-1000 #223