0

Normally I can use javac to compile and java to run perfectly fine, they are set correctly into my computer's classpath. In this instance however, one of my files Graph.java is trying to import a jar file in the same directory Heap.jar.

When I try to use javac *.java, it tells me package mycs1 does not exist.

Normally in my lab on Linux machines, we can use export CLASSPATH=mycs1.jar:. and then javac will work normally again, and just add more files if there are more jars.

My problem is that this command does not work on my home computer running Windows 10. I am trying to set the classpath of multiple jars. This is similar to this question: Unable to execute jar file despite having PATH and CLASSPATH set

But despite reading that, I still cannot find a way to set the path of multiple jar files in such a way that javac will work.

Is this possible? If not, what alternative command can I use?

Community
  • 1
  • 1
  • You can use the javac command's -cp option to point to multiple jar files: D:\Java\jdk1.8.0_25\bin\javac.exe -Xlint -cp .;javadocx.jar;stdlib.jar – NormR Dec 07 '16 at 02:18
  • Can you explain what you mean by this? I just get "javac: no source files", and I'm not sure what the Xlint part is or the path before it. – chasekenyon Dec 07 '16 at 03:03
  • "D:\Java\jdk1.8.0_25\bin\javac.exe -Xlint -cp .;javadocx.jar;stdlib.jar TheProgram.java" is the contents of a call to the javac command from the command line. The tokens with - are javac options. See the API doc for the javac command. – NormR Dec 07 '16 at 12:00

0 Answers0