java 找不到 javac - 在 Windows 7 64 位上为 JDK 设置了 CLASSPATH/Path/JAVA_HOME
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6712701/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
javac cannot be found - CLASSPATH/Path/JAVA_HOME set for JDK on Windows 7 64-Bit
提问by Luke Shaheen
I've looked in numerous threads here and on Google and cannot find a solution.
我在这里和谷歌上查看了许多线程,但找不到解决方案。
I've installed the latest version of Java JDK (1.6.0_26) on my 64-bit Windows 7. I've added the file path "C:\Program Files (x86)\Java\jdk1.6.0_26" to JAVA_HOME, and added "C:\Program Files (x86)\Java\jdk1.6.0_26\bin" to the CLASSPATH and PATH variables. I've restarted my machine. But, I when I go to to run javac -version from the command line, I receive the error
我已经在我的 64 位 Windows 7 上安装了最新版本的 Java JDK (1.6.0_26)。我已经将文件路径“C:\Program Files (x86)\Java\jdk1.6.0_26”添加到 JAVA_HOME,并将“C:\Program Files (x86)\Java\jdk1.6.0_26\bin”添加到 CLASSPATH 和 PATH 变量中。我已经重新启动了我的机器。但是,当我从命令行运行 javac -version 时,我收到错误
'javac' is not recognized as an internal or external command, operable program or batch file.
Please let me know what I should do! I'm attempting to use Appcelerator's Titanium but it requires a valid path for javac. Thanks!
请让我知道我该怎么做!我正在尝试使用 Appcelerator 的 Titanium,但它需要一个有效的 javac 路径。谢谢!
For reference, here is my PATH variable.
作为参考,这是我的 PATH 变量。
C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x8
6)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\
Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Fil
es\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Progra
m Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shar
ed\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:
\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (
x86)\Common Files\Roxio Shared\OEM.0\DLLShared\;C:\Program Files (x86)\Roxio\
OEM\AudioCore\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\WIDCO
MM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64; C:\
Program Files (x86)\Java\jdk1.6.0_26\bin;
采纳答案by Luke Shaheen
The error is just what it says. javac
is not found on the path.(This issue has nothing to do with Java, rather windows cannot find the unqualified executable in the current path or search "PATH" paths.)
错误正是它所说的。javac
在路径上找不到。(此问题与Java无关,而是windows无法在当前路径中找到不合格的可执行文件或搜索“PATH”路径。)
Locate the javac
file manually. Verify it can be run with the found path.
javac
手动定位文件。验证它可以使用找到的路径运行。
Ensure the path is put in PATH environment variable correctly (it mustbe separated from other entries with a semi-colon (;
)). The CLASSPATH is not relevant here. Depending on how PATH is set, it may require restartingthe windows shell (e.g. log out and log back in). Verify the new PATH is correct with echo %PATH%
from a console.
确保路径正确放入 PATH 环境变量中(它必须与其他条目用分号 ( ;
)分隔)。CLASSPATH 在这里不相关。根据 PATH 的设置方式,可能需要重新启动windows shell(例如注销并重新登录)。echo %PATH%
从控制台验证新的 PATH 是否正确。
Run javac
and verify it is executed.
运行javac
并验证它已执行。
Happy coding.
快乐编码。
回答by Java newbee
I was facing the same problem, I set the path in command line:
我遇到了同样的问题,我在命令行中设置了路径:
set path = "c:/...."
设置路径 = "c:/...."
but it was not recognized as path, than I checked my Windows type (x64) and Java type (x64). Then I set the path manually in system variables in the properties of My computer and re-opened the cmd prompt, it worked.
但它未被识别为路径,而不是我检查了我的 Windows 类型 (x64) 和 Java 类型 (x64)。然后我在我的电脑属性中的系统变量中手动设置路径并重新打开cmd提示符,它起作用了。