Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confusion for 1.4 and 1.5

 
anamika henry
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends ..I am apperaring for java 1.5 ..i have 1.4 installed do i need to install 1.5 to run all the codes of generics,enum etc which are not in 1.4..do i need to uninstall 1.4 before installing 1.5.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is better placed in our beginners' forum...
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To use generics and enums, you need Java 5 (aka JDK 1.5). You can ask the Java 5 compiler to produce code that will run on Java 1.4; use "-target 1.4". However, note that if you use any API classes that are not present in Java 1.4, this will not help with that.

You can happily have lots of versions of Java installed all at once. I have 1.1, 1.4 and 6 at the moment. Only one can be the default Java in your Web browser, but that's mostly not relevant to Java application development.

If you do have multiple versions installed, you must take care which one you invoke; either use the full path to commands like "java" and "javac" or adjust your PATH variable when switching versions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic