How to install an older version of JDK on Mac?

I need to install JDK 5 to test the Amazon Mechanical turk API (which is not fully compatible with JDK 6). On the Apple website, I can only find the latest JDK. Is there a way to get older versions of the JDK for Mac?

+4
source share
4 answers

You can compile with 1.5 jdk with settings in javac.

In your case:

javac -source 1.5 -target 1.5 

You can even install this in your IDE. Or you can do it with maven and maven.compile.target and maven.compile.properties


-source release

Indicates the version of the accepted source code. The following release values ​​are allowed:

[...]

  • 1,5
    The compiler accepts code containing generics and other language functions introduced in JDK 5.

[...]


-target version

Generate class files for the specified version of the virtual machine. Class files will run on the specified target and in later versions, but not on earlier versions of the virtual machine. Acceptable goals: 1.1 1.2 1.3 1.4 1.5 (also 5 ) and 1.6 (also 6 ).
The default value for -target depends on the value of -source :

  • If -source is not specified, the value of -target 1.6
  • If -source 1.2 , value -target 1.4
  • If -source 1.3 , value -target 1.4

For all other -source values, the -target value is the -source value.


Resources:

0
source

Yes, this is a problem with macs.
If you make backups, you can simply copy the old folders containing jdk 5 from the backup drive back to your computer. Worked for me.

0
source

use

-target 1.5

0
source

All Articles