即使在Windows XP中设置路径后,javac也无法工作

时间:2013-08-01 11:25:11

标签: windows javac

朋友即使我设置了路径

,我也无法在我的xp中访问java

我将路径设置为path="C:\Program Files\Java\jdk1.7.0_25\bin" 它在xp中不起作用但它在我的Windows 7系统中很有用 不知道为什么 请回答我 我还在环境变量选项卡中设置了路径变量。但这对我不起作用 我的javac命令仍然表示javac无法识别外部或内部命令。 所以请帮帮我

3 个答案:

答案 0 :(得分:2)

在命令提示符/ CMD

中运行此命令
set path="%path%;c:\program files\java\jdk1.7.0_25\bin"

如果您已经打开了终端实例,则必须将其关闭并重新打开才能工作。确保此路径C:\Program Files\Java\jdk1.7.0_25\bin有效并且javac

答案 1 :(得分:1)

1>首先检查您的PC中是否真的安装了Java。 你可以通过去做 C drive-> Program Files-> Java

在java中你应该有两个文件夹 1. jdk 2.jre

2 - ;复制路径C:\ Program Files \ Java \ jdk1.7.0_25 \ bin (jdk1.7.0_25是你提到的安装的jdk版本)

3>转到高级系统设置,然后单击环境变量

4>单击new,您将有两个填充变量名称和变量值。  在变量名中键入“PATH”(不带双引号和CAPS) 并将复制的路径粘贴到变量名称字段中。

5>现在打开一个新的命令提示符并输入javac。 您应该看到一个列表,而不是您提到的错误。

另一种方式..但这种方式只是一种临时解决方案,因为一旦关闭cmd,您将不得不再次设置路径。 你甚至可以设置path =(粘贴你在等号后复制的路径)

答案 2 :(得分:0)

首先按照以下步骤进行操作

Start -> Control Panel -> System -> Advanced
Click on Environment Variables, under System Variables, find PATH, and click on it.
In the Edit windows, modify PATH by adding the location of the class to the value for PATH.
If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Close the window.
Reopen Command prompt window, and run your java code.

现在运行where java。这应该返回java路径到java.exe

如果您仍有问题,请发表评论

相关问题