aspose file tools*
The moose likes Beginning Java and the fly likes  'javac' is not recognized as an operable program or batch file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark " Watch " New topic
Author

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

Jeremy James Brown
Greenhorn

Joined: Mar 24, 2011
Posts: 27
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

Joined: Feb 24, 2011
Posts: 495

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


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Jeremy James Brown
Greenhorn

Joined: Mar 24, 2011
Posts: 27
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

Joined: Mar 24, 2011
Posts: 27
BTW java works from the c:\Users\User> prompt just not javac.
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

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

Joined: Mar 24, 2011
Posts: 27
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

Joined: Oct 13, 2005
Posts: 39834
    
  28
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 'javac' is not recognized as an operable program or batch file