I'm new to Macs and have been asked to try to get some home applications to work on a Mac kept at my mum's house. Its a G4 nd runs Leopard 10.5.4, albeit slowly.
In the past it has run Java applications OK. Recently however I have tried copying three newly compiled versions of Java programs to it and none of them work at all. An earlier compiled application that was already on the Mac from some previous time still works ok.
The error message with the failure cases is something like "Bad version number in .class file". Currently the only explanation that I can think of is that I have updated my PC based version of Java (on which I did the development of the programmes) to 1.6.0_25 and that this is no longer backwards compatible for the version of Java on Leopard which is 1.5.0_13.
I've looked in Java preferences on the Mac and this confirms that it doesn't have 1.6, just 1.5xx and 1.4.2. I've then looked on various Mac resources and it seems possible to get hold of updates, e.g. http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_4 that will simultaneously "updates Java SE 6 to version 1.6.0_13, J2SE 5.0 to version 1.5.0_19". However, I am guessing that this will not solve the problem, presumably I need to get hold of a full version of Java at 1.6.
I'm a Mac newbie, its not at all clear why I can't apparently find this on the Apple support site. I don't find the site's layout at all transparent.
So, my questions are:
- Do I actually need Java 1.6 on the Mac for it to run simple applications compiled with 1.6 on a PC?
- Can someone point me in the right direction to get hold of a complete Java 1.6 download for Mac?
- Will it actually work on a Mac as old as this?
Apple's Java 6 implementation does run on OS X 10.5, but only on Intel processors, not PowerPC, so you're out of luck. In case you're nonetheless interested in it (maybe to get the latest Java 5), you can find it at http://support.apple.com/kb/HT4140 - it's Update 7, not Update 4.
Check out SoyLatte for an alternative Java implementation that may run on PowerPCs.
Ping & DNS - updated with new look and Ping home screen widget
Joined: Jun 21, 2011
Hi, thanks for the quick reply, I will certainly look into both approaches more.
One additional point, and I'm also a relative newcomer to Java also, I was surprised to see the Mac support for Java 1.5 ontinues. The implication is that I am at liberty to continue compiling software at that version, if I can get hold of a JDK at 1.5 for my PC.
- Does this mean that it is no less safe, in security terms, to continue to write java programs in 1.5?
- How can I easily arrange to have both Java 1.5 and 1.6 on my development PC? Would I actually need to decide to completely revert to 1.5?
Using 1.5 isn't a problem for me at the moment, I had only upgraded to 1.6 because of, perhaps misplaced, notions that it was best to stick with the latest version from a security perspective.
Joined: Mar 22, 2005
The security issue is most important when it comes to running code by other people who you don't trust - that chiefly applies to applets. If you use Java mainly for running your own code, I wouldn't rank its importance as highly. And even though Java 5 has been end-of-life'd a while ago, it has seen several security updates since, because many people still use it.
It's no problem installing and using multiple Java versions in parallel under Windows. You'll need to think about how to set them up (for example, Java_HOME and PATH can only point to a single installation at any one point, so you'd need to switch those around); but it's certainly possible.