This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic