• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JDK Version Problem

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I want to use JDK1.7 and JDK1.6 for different projects on my workstation. but when I install both JDK 1.7 supersedes and 1.6. I have set environment variables accordingly, but it doesn't seem to work.
Can you please help me to do it. I need to work on both projects at the same time one is using 1.6 and another 1.7.


Thank You.
 
Greenhorn
Posts: 9
Netbeans IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suppose you must be using some sort of IDE like eclipse of Netbeans or any IDE. All IDEs provide you the feature to choose the build compiler version.

For netbeans, Open Project Properties and do as is shown in the image :-



Here you can add different Platform for your project and choose to compile your project using that version of Java. Similar options you will find in eclipse and IntelliJ as well.


Hope that helps

Thank you,
Sincerely,
Psycho_Coder.
 
Marshal
Posts: 80226
424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the command line/terminal, you can set the PATH for each run. I think on Windows® you use a command like
SET PATH=c:\Program Files\java\jdk1.6.0_99\bin;%PATH%
and for *nix
export PATH=/usr/java/jdk1.6.0_99/bin:$PATH
In the first example, because there are spaces in the text, you may need to put quote marks after = and before ;
I think that PATH is valid for that particular instance of the terminal/command line or until you change the PATH again.
 
We don't have time for this. We've gotta save the moon! Or check this out:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic