Java class path

I am learning java at the moment and I am a little confused about where and how to set the classpath?

I am using Jcreator Pro.

Do I install it in source file or IDE or Windows somewhere?

Any help would be greatly appreciated.

+2


source to share


1 answer


You can install it in multiple locations :-)

You will install it in your IDE so you can compile and run from that environment. I'm not familiar with JCreater, but I suspect most IDEs have already set the classpath for you. It will be installed to the directory where JCreator writes classes. If you are using third party JAR servers, they must be in the classpath too. In your IDE, you may have to add them manually (look for "add JAR" or "add libraries" or similar).



You can also set the classpath when running the java compiler or runtime (javac and java) from the command line. You do this with the "-cp" option followed by a list of directories and JARs that you want to use in the classpath.

There are other places to set classpaths as well. If you are building something other than an IDE (for example with Maven or Ant, two popular build tools), you will need to set the classpath using the methods provided.

+3


source







All Articles