简体   繁体   中英

javac not recognized as an internal or external command

What are the path variable supposed to be to ensure "javac" will work? Should it be in both system and user variables and should the "\\bin" part be included?

I have a Program Files and Program Files(x86) and the JDK is in both. Which one should i use? Eclipse is working perfectly, it's only when using command line that I get this. Anyone?

Eclipse comes with its own Java compiler, it doesn't have to use an external one.

You should find the bin directory under whichever JDK you want to use and then add it to the path (I prefer the user path but, since I only ever run as one user, I'm not sure what the difference is).

And make sure it's the JDK, not just the JRE.

For example, mine is in c:\\program files\\java\\jdk1.6.0_17\\bin (32-bit WinXP).

One final thing, if you're changing the environment variables in the control panel, that won't affect cmd windows that are already open. You'll need to open up a new one to get the new environment settings (trap for wary players).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM