1

I'm trying to compile and run java file using the command line, but it's not working. I've followed the steps on http://introcs.cs.princeton.edu/java/15inout/windows-cmd.html, using the correct file path and a current jdk and I still get javac is not recognized when typing javac -version. What am I doing wrong?

2
  • Please paste the full jdk\bin present in your PATH Commented Oct 5, 2012 at 5:18
  • C:\Program Files (x86)\Java\jdk1.7.0_07\bin; javac works now, but when trying to run my simple java file by entering java test I get Exception in thread "main" java.lang.UnsupportedClassVersionError Commented Oct 5, 2012 at 19:16

2 Answers 2

1

You need to add the folder where javac exists to your PATH. It might not be the same path specified in the given link.

Sign up to request clarification or add additional context in comments.

1 Comment

close cmd and start again, the path is not refreshed for an already opened session
0

Please follow this link to set PATH and CLASSPATH for java in windows

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.