Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

'javac' is not recognized as an operable program or batch file

 
Jeremy James Brown
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not able to set the path to javac in Windows 7 64bit home premium

I've viewed several webpages on this issue and they are all either vague, outdated, or don't solve my problem.

I have the newest (or very new at least) version of Java installed here.
C:\Program Files\Java\jdk1.6.0_23\bin

I know javac is present and working because I can cd to its directory and return "Usage: javac..."
And, also because Eclipse is running normally.

I've entered a path for the Java bin in Environment Variables

User Variable "CLASSPATH" Value "%classpath%"

and System Variable "JAVA_HOME" Value "C:\Program Files\Java\jdk1.6.0_23\bin"

I would really like to run javac without having to cd, from .java files I type manually. I've got a lot to learn and so I guess it starts here at the beginning, just running the complier from cmd.

Thanks.
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeremy James Brown wrote:I'm not able to set the path to javac in Windows 7 64bit home premium

I've viewed several webpages on this issue and they are all either vague, outdated, or don't solve my problem.

I have the newest (or very new at least) version of Java installed here.
C:\Program Files\Java\jdk1.6.0_23\bin

I know javac is present and working because I can cd to its directory and return "Usage: javac..."
And, also because Eclipse is running normally.

I've entered a path for the Java bin in Environment Variables

User Variable "CLASSPATH" Value "%classpath%"

and System Variable "JAVA_HOME" Value "C:\Program Files\Java\jdk1.6.0_23\bin"

I would really like to run javac without having to cd, from .java files I type manually. I've got a lot to learn and so I guess it starts here at the beginning, just running the complier from cmd.

Thanks.


Are you sure it's not supposed to be:
"C:\Program Files (64)\Java\jdk1.6.0_23\bin"
instead of:
"C:\Program Files\Java\jdk1.6.0_23\bin"?

And:
C:\Program Files (64)\Java\jdk1.6.0_23\bin
instead of:
C:\Program Files\Java\jdk1.6.0_23\bin

And anyway, we are at update 24, not 23.
Hope I helped,
cc11rocks aka John Price
 
Jeremy James Brown
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
john price wrote:
Are you sure it's not supposed to be:
"C:\Program Files (64)\Java\jdk1.6.0_23\bin"
instead of:
"C:\Program Files\Java\jdk1.6.0_23\bin"?


I cut the path directly from windows explorer, and also get a return from javac if I cd to that directory in cmd, so I don't think so. Thanks for your quick reply.
 
Jeremy James Brown
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW java works from the c:\Users\User> prompt just not javac.
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem. Sorry I couldn't help. But, to help you I'll tell you what my relevant "environment variables" are. You may be missing one?

Hope this fixes it
cc11rocks aka John Price
 
Jeremy James Brown
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Added "C:\Program Files\Java\jdk1.6.0_23\bin" to the path variable

Rebooted, confirmed the edit with cmd> echo %path%

javac works.

Thanks
 
Campbell Ritchie
Sheriff
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is often a Java™ runtime in the Windows folder, so the "java" command will work even if the path to your installation is incorrect.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic