Should I use Java 1.5 already?

The question that keeps coming to my mind is “if it’s that simple*, why didn’t Sun do it?” (e.g. javac -target 1.4)

Have you tried selling Retroweaver to Sun :slight_smile: ?

*by “simple” I don’t mean to imply it was a peice of cake (I don’t know maybe it was), just that one guy came up with Retroweaver in what appeared to be a very short amount of time. Something that Sun surely had the resources to do on their own.

Interesting about that MacOSX issue! Putting end-user deployment concerns aside for the moment, is it possible to develop 5.0 applications on OSX? The linked article seems to imply that it isn’t, but that can’t be right.

There must be a free-to-download beta or something, surely?

You have to pay to get access to the OS X 10.4 betas*, and the Java 5.0 beta that can be installed with it. If you are in a rush and aren’t concerned with the ethical issues, you can download a developer preview of OS 10.4 that is quite old and was given out at the Mac developers conference earlier this year, but you will still need to find a way to get the Java 5 beta. I think it is possible that you can do all this legally if you find a (paid subscription) ADC member that has some sort of “credits” that they can transfer to you if you become a (free) ADC member. I don’t know much about that though.

That being said… you might be able to hack the Linux/PC versions to compile Java 5 code on the Mac - after all the compiler is written in Java and most of the class files don’t require native code. The only problem would be if the compiler itself required Java 5… but you might be able to run it through Retroweaver to get it to run on the Mac’s pre-installed Java 1.4

*There is actually a “deal” they have now where you pay $500+ and get a 1-year ADC membership WITH Tiger (OS 104) pre-releases and some presentations about Tiger development, and it entitles you to the final release when it is available next year.

[quote]The question that keeps coming to my mind is “if it’s that simple*, why didn’t Sun do it?” (e.g. javac -target 1.4)
[/quote]
There’s an entire thread on this matter over at Sun’s forums, http://forum.java.sun.com/thread.jsp?forum=316&thread=503547

The gist of it is that Neal Gafter (Sun’s used-to-be compiler writer) said that Sun refuses to support -source 1.5 -target 1.4, because there is no specification that addresses it. Neal also explicitly expressed support for Retroweaver.

It seems like half the people that I talk to about Retroweaver actually try it and say, “Retroweaver Rocks!”. The other half stand around trying to figure out why Retroweaver can’t possibly work. Meh.

God bless,
-Toby Reyelts

[quote]The gist of it is that Neal Gafter (Sun’s used-to-be compiler writer) said that Sun refuses to support -source 1.5 -target 1.4, because there is no specification that addresses it.
[/quote]
Well bloody hell… why don’t they write the darn spec!

I think I’m going to try to integrate Retroweaver into my build process, but only for the Mac version of my application. The Windows and Linux versions will require 1.5. We will be bundling the VM on Windows anyway, though sadly it will be a private install only used for our apps.

yeah its the best for aussie use only. cuase all you americans can’t afford to upgrade.

go and buy a gameboy you poor homeless idiotic loserest badestly worstly devilish demonic horridly stupidlessly losers!!! (please don’t report me, i didn’t mean it!)

ur the best ever

Alrighty, what am I missing here?

FileInputStream is = new FileInputStream(path);
ObjectInputStream ois = new ObjectInputStream(is);
Map<Integer> map = (Map<Integer>)ois.readObject();

[quote]Unsafe type operation: The cast from Object to parameterized type Map will not
check conformance of type arguments at runtime
[/quote]
How do I stop this warning occurring? Or are Generics incompatible with Serialization? :-/

I think if someone had 1.4, they’d probably be willing to get 1.5 since a lot of 1.4 users probably downloaded it at some point. The rest are still stuck in 1.1 and will just leave when your site doesn’t work.

[quote]How do I stop this warning occurring? Or are Generics incompatible with Serialization? :-/
[/quote]
I don’t know if there’s any way to stifle that warning, but there’s no way for you to get around the basic problem. Because of type erasure, the runtime can’t possibly know what type parameters an instance of generic class has been instantiated with. All the compiler is doing is telling you that it can’t guarantee you that the Map you read out is actually a Map. If you’re wrong (for example, the Map contains Strings), you’ll get spurious ClassCastExceptions, where your code contains no explicit casts. Nothing you can do about that.

God bless,
-Toby Reyelts

[quote]Putting end-user deployment concerns aside for the moment, is it possible to develop 5.0 applications on OSX? The linked article seems to imply that it isn’t, but that can’t be right.

There must be a free-to-download beta or something, surely?
[/quote]
It costs a minimum of $500 to get seed keys for Tiger, which allows you to download the betas for free. That $500 gives you 5 seed access keys, which you can then give to other people with the free Online membership.

If you have access to Tiger seeds, there are various betas of 1.5, so any developer with 10.4 access and the interest can try out 1.5 on the Mac.

A group of open source projects could certainly pool their pennies to get early access if they want it, but I do not know of that occurring. Also, if you can get someone with access fired up about your project, they could provide such a seed if they have a spare. (I have done that in the past.)

Most open source projects just wait until release, then have a flurry of fixes they try to get in place. I am surprised by this each time.

We will likely find out on 1/11 when Tiger is going to ship. At that point, you then have to expect some delays for the user base, but developers will likely be running it fairly fast. I am not interested in violating my NDA, but I will say that the 8A323A prerelease I installed to work with tiger-specific code has been stable enough for me to use the rest of the time.

Scott