• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

path v classpath  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to java.
can anyone tell me wat is the difference between path and a class path
and also how to set the both in command prompt.
[ September 22, 2008: Message edited by: David O'Meara ]
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "path" is the path the operating system uses to find execuatables. The "classpath" is the path the JVM's class loader uses to find classes (and other resources). Have a read of our FAQ on the subject.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
google
 
Marshal
Posts: 60795
190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by yohn lee:
google

I think Paul Sturrock's answer was much more useful.

This old thread has details of setting the PATH on Windows from the command line. It would probably be better to add the java part to the beginning of the PATH.

On Linux it varies, but you write something like

export PATH=/usr/bin/java/jdk1.6.0_07/bin/:$PATH

Note the Java entry always ends with "bin".

[edit]Add: You don't usually need to set the classpath as an environment variable[/edit]
[ September 22, 2008: Message edited by: Campbell Ritchie ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!