• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use JDK & JRE without setting the path in environment variable

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
if i want to run java programs on my PC i have to set JAVA_HOME and PATH in environment
variables .

so once we do that , and type in CMD that "java -version", it gives me which version my JDK installed is
and if i do 'echo %PATH%' i'm able to see all the folder struture which are in the path.

Now my question is,

in my current Project we are using JDK 1.4 ,
if i do 'java -version' it shows as follows,


if i do echo %JAVA_HOME% nothing is shown,

but if i do 'echo %PATH%' it gives me following info


Hence my question is, if i install latest Netbeans 6.X or latest Eclipse and just give the JDK 6 path in the IDE's environment variables, will it effect my Systems PATH which still takes jdk 1.4.2

For my Live projects which uses Jdk 1.4.2 , we are using Oracle JDeveloper IDE

Please suggest me
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can create a project in an IDE.

For example in eclipe create a project and use the .classpath file to store your classpath
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Telling an IDE to use a specific JRE for executing won't affect anything else on your system.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rahul Shivsharan wrote:hi,
if i want to run java programs on my PC i have to set JAVA_HOME and PATH in environment
variables .


You don't really have to do that, Java doesn't require those environment variables to be set - it's just for convenience.

You can instead just type the full path each time you want to execute a Java program. Try typing in this:

C:\oracle\BIToolsHome_1\jre\1.4.2\bin\java -version

Setting the PATH is just so that you don't have to type the whole path every time. And Java itself does not use JAVA_HOME at all.
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic