• Post Reply Bookmark Topic Watch Topic
  • New Topic

'java' is not recognized as an internal or external command, operable program or batch file.  RSS feed

 
John Simer
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help, I can compile(javac) my program, but not run(java) it.

"C:\Program Files\Java\jdk1.6.0_30\bin>javac C:\jvj\HelloWorldApp\HelloWorldApp.java
C:\Program Files\Java\jdk1.6.0_30\bin>cd\jvj\HelloWorldApp
C:\jvj\HelloWorldApp>dir
Volume in drive C is ACER
Volume Serial Number is A057-D808
Directory of C:\jvj\HelloWorldApp
12/20/2011 08:48 PM <DIR> .
12/20/2011 08:48 PM <DIR> ..
12/20/2011 09:00 PM 432 HelloWorldApp.class
12/20/2011 01:43 PM 118 HelloWorldApp.java
2 File(s) 550 bytes
2 Dir(s) 75,082,752,000 bytes free"

but running it doesnt work.

"C:\jvj\HelloWorldApp>java HelloWorldApp
'java' is not recognized as an internal or external command,
operable program or batch file."

likewise,

"C:\jvj\HelloWorldApp>java -cp . HelloWorldApp
'java' is not recognized as an internal or external command,
operable program or batch file."

and,

"C:\jvj\HelloWorldApp>java -classpath . HelloWorldApp
'java' is not recognized as an internal or external command,
operable program or batch file."

What do I do?
------EDIT----
Well the whole time my path variable wasnt working. Turned out i needed to restart the cmd



yipee!

Thank you for all the help,
God Bless you with true peace
 
Kumaravadivel Subramani
Ranch Hand
Posts: 171
Java Linux Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The CMD Prompt will not be updated when the environment variable has changed, so always close and re-open it to have the impact.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!