• 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
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

path and classpath?

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

what is path and classpath? I have my j2sdk1.4.2_04 installed on my c drive, How should I set my path and classpath in such a way(if possible) that it should facilitate me to compile and run my java programs no matter where i create and compile and run on my entire hard drive (other than c drive).

Please give me a detailed explanation.

You guys are all doing a great job here and Many thanks in advance.
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a detailed description in this FAQ, http://faq.javaranch.com/view?HowToSetTheClasspath
 
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To be able to compile and run Java programs you need to have the bin directory of your Java install in your PATH. You do not need to do anything with CLASSPATH. You can either set it like this in your command shell:
SET PATH=%PATH%;C:\j2sdk1.4.2_04\bin
or
set in your system environment PATH.

If you do the first method, you have to set the path every time you open a new shell. It's usually more convenient to set your PATH in the system environment variables unless you need to be able to run more than one version of Java and switch between the 2 easily.
 
Kriss Reddy
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many thanks for your replies.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At this point, I strongly suggest that you DO NOT set your CLASSPATH environment variable. The important part at this juncture is to set the PATH variable so that the operating system will be able to find the Java compiler and runtime executables. Until you start learning about packages and using 3rd party libraries, you don't need to worry about CLASSPATH.

Layne
 
Normally trees don't drive trucks. Does this tiny ad have a license?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic