找不到 javac - 在 Windows 7 64 位上为 JDK 设置的 CLASSPATH/Path/JAVA_HOME

发布于 2024-11-24 09:27:22 字数 1370 浏览 2 评论 0原文

我在这里和谷歌上查看了许多线程,但找不到解决方案。

我已经在 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.

请让我知道我应该做什么!我正在尝试使用 Appcelerator 的 Titanium,但它需要 javac 的有效路径。谢谢!

作为参考,这是我的 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\12.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;

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

'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!

For reference, here is my PATH variable.

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\12.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;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦里泪两行 2024-12-01 09:27:22

错误正如其所言。路径上找不到javac(此问题与Java无关,而是Windows无法在当前路径中找到不合格的可执行文件或搜索“PATH”路径。)

找到手动创建javac 文件。验证它可以使用找到的路径运行。

确保路径正确放入 PATH 环境变量中(必须使用分号 (;) 与其他条目分隔)。 CLASSPATH 在这里不相关。根据 PATH 的设置方式,可能需要重新启动 Windows shell(例如注销并重新登录)。使用控制台中的 echo %PATH% 验证新的 PATH 是否正确。

运行 javac 并验证它是否已执行。

快乐编码。

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.)

Locate the javac file manually. Verify it can be run with the found path.

Ensure the path is put in PATH environment variable correctly (it must be separated from other entries with a semi-colon (;)). The CLASSPATH is not relevant here. Depending on how PATH is set, it may require restarting the windows shell (e.g. log out and log back in). Verify the new PATH is correct with echo %PATH% from a console.

Run javac and verify it is executed.

Happy coding.

游魂 2024-12-01 09:27:22

我遇到了同样的问题,我在命令行中设置了路径:

设置路径=“c:/....”

但它不被识别为路径,比我检查我的 Windows 类型 (x64) 和 Java 类型 (x64) 。然后我在我的电脑属性中的系统变量中手动设置路径并重新打开cmd提示符,它起作用了。

I was facing the same problem, I set the path in command line:

set path = "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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文