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

Path and classpath required

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
to run java program, what complete path and classpath to be set as an enivronment variable.
Also tell me ,what value should be set for JAVA_home and why JAVA_HOME is needed
 
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAVA_HOME must point to your java install directory and you should also include %JAVA_HOME%/bin in your path (Because you have the executables in the bin directory).Classpath refers to dependencies,that will depend on the application.

Regards,
Srikkanth.M
 
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
You do not need to set any environment variables to be able to run Java programs.

You can add the bin directory of the Java Runtime Environment (JRE) or Java Development Kit (JDK) to the PATH if you want - this is only for convenience, so that you don't have to type the whole path every time.

You do not need to set CLASSPATH. If you need the JRE to look for classes in other places than the directory from where you start your program, then you can set the classpath on the command line with the "-cp" (or "-classpath") option.

The variable JAVA_HOME is not used at all by the JRE or JDK. Some programs use this to find your Java installation (Apache Tomcat for example), but Java itself does not need it.
 
Srikkanth Mohanasundaram
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jesper,

That was very helpful.It weeded out certain misconceptions.

Thanks,
Srikkanth.M
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic