Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

installing multiple versions of java

 
Greenhorn
Posts: 11
VI Editor Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers,

I want to know how to install java i.e. in order to run java programs what are all the necesssary packages required...
in the same context I would want to install java on windows(XP) as well as on linux (ubuntu) systems,
and also can I be able to install different versions of java 5, 6, 7 on the same OS?

PS: kindly provide a link to get the java package (required to install) (5, 6, 7) versions.

Thank you.
 
Ranch Hand
Posts: 36
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Srini

It is very much possible to install multiple versions of java in one OS. You will have to point to the right Java version when you run java programs.i.e The version you need.
If you are looking at Sun jdk the link for installables is http://www.oracle.com/technetwork/java/archive-139210.html

Thanks
Deepak
 
Ranch Hand
Posts: 251
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use latest version and you can compile java file from different version from latest version.

eg.

javac -target 1.4 *.java
javac -target 1.5 *.java
javac -target 1.6 *.java

The -target 1.4 option ensures that the generated class files will be compatible with 1.4 VMs.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can definitely install and use multiple versions of JDK on a single machine/OS. Just install the JDKs into different folders and then change the version when compiling your programs. If you want to test your code using different Java versions, you can create .bat files with various versions and then just execute one of those .bat files before using a particular version. For example, a .bat file for JDK 1.6 might look something like this:



You can name the file as jdk6.bat and then only execute this file before testing your program. You can do the same for other JDK versions.
 
srini manassu
Greenhorn
Posts: 11
VI Editor Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Deepak:
Thanks for the links, I really wanted one.

@Sachin:
Yeah this is the cool (simple) option, Thanks for letting me know.

@Shahzad:
I think you are a windows guy the .bat is good, thanks, I don't regularly use windows, but this helped me do some ``work'' with windows
 
Shahzad Latif
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Sirini,

I assumed you were using Java on Windows. My bad!
 
reply
    Bookmark Topic Watch Topic
  • New Topic