• Post Reply Bookmark Topic Watch Topic
  • New Topic

Classpath  RSS feed

 
Manish Ranjan Singh
Greenhorn
Posts: 1
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All. This is Manish from India. I wanna know how to set classpath in java?
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!