Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (blazeryder):

I am having a hard time running a Java program in my cmd. I have tested it out many times in Eclipse but when ever I type javac ProgramName.java it says javac is not a recognized command. I have looked all over the internet and none of the solutions work. Please help!

OpenStudy (rsmith6559):

javac is JAVACompiler. The runtime is java. Assuming your PATH variable includes the directory that java is in, the command would be: java yourProgramName Interestingly, you DON'T use the .class extension for this, just it's name.

OpenStudy (blazeryder):

So in the CMD type javac ProgramName. After I do that I then can type java ProgramName. Right? So don't use the .java at the end of the program?

OpenStudy (blazeryder):

Here is a screen shot of the message that I get when I do what you say @rsmith6559 =)

OpenStudy (rsmith6559):

Try: java Displacement NOT javac. You appear to have the Java runtime, not the Java SDK, so you don't have javac.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!