File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Classpath" Watch "Classpath" New topic
Author

Classpath

Manish Ranjan Singh
Greenhorn

Joined: Dec 22, 2011
Posts: 1

Hello All. This is Manish from India. I wanna know how to set classpath in java?
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 3143
Manish Ranjan Singh wrote:Hello All. This is Manish from India. I wanna know how to set classpath in java?


Please SearchFirst(⇐click) and ShowSomeEffort.(⇐click)
how to set classpath in java(⇐click)
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 26720
Welcome to the Ranch

Short answer: don’t.

Long answer: a system classpath usually does more harm than good, so you ought not to set it. The JVM/javac/whatever is programmed to look in the “current” directory if there is no system classpath. That is what you usually want. It is a good idea to create a java folder. When you are more advanced and are using jar files from elsewhere, you can use the -cp flag to set a classpath, or you can set a classpath in the manifest file of a jar.

If you can run a HelloWorld program successfully, you will be all right without a classpath, probably for about a year.
 
IntelliJ Java IDE
 
subject: Classpath
 
Threads others viewed
Compiling, but not running !!!
Running application from command mode (MS DOS WINDOW)
class 1
how to use ClassLoader ???
Web Application Architecture
IntelliJ Java IDE