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!
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.
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?
Here is a screen shot of the message that I get when I do what you say @rsmith6559 =)
Try: java Displacement NOT javac. You appear to have the Java runtime, not the Java SDK, so you don't have javac.
Join our real-time social learning platform and learn together with your friends!