Java执行错误
我已经为我的java苦苦挣扎了近2天。由于我正在上计算机科学课程,因此我们必须在不使用 IDE 编程的情况下开始。 首先,我遇到了“javac”命令的问题,我设法解决了这个问题,之后一切正常,因为程序在控制台等中运行。但是今天启动我的计算机后,执行不起作用!这怎么可能?
信息:
我下载了很多java版本,但这就是我拥有的文件类型:
- 在C:\ Program Files \ Java中我有4个文件夹:jdk1.7.0_01,jdk1.7.0_02,
- jre6,jr7在C:\ Program Files (x86)\Java 我有一个文件夹; jre6
我的环境变量:
我的“PATH”位于管理员的用户变量中:
C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\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;.;
而我的 CLASSPATH 位于系统变量中:
.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
我班上的朋友都没有遇到同样的问题,因为他们下载 Java 时一切正常。我不知道我做错了什么,我现在下载了很多java(如你所见),现在这需要我所有的时间来修复。我正在认真考虑放弃这门课程,因为我将无法完成我在 Java 编程中的第一个该死的任务,因为我必须整天用谷歌来解决这个问题......
最好的问候。
I have struggled for almost 2 days now with my java. Since I'm taking a computer science class, we will have to start without programming in an IDE.
First of all I had the problem with the "javac" command which I managed to solve, everything worked after that as programs ran in the console etc. But after starting up my computer today executing didnt work! How is that possible?
Information:
I have downloaded lots of java versions, but this is what kind of files I have:
- In C:\Program Files\Java I have 4 folders: jdk1.7.0_01, jdk1.7.0_02,
- jre6, jr7 In C:\Program Files (x86)\Java I have one folder; jre6
My environment variables:
My 'PATH' is in User variables for Administrator :
C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\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;.;
While my CLASSPATH is in System variables:
.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
None of my friends in my class have the same problem as everything worked fine for them when they downloaded Java. I dont know what Ive done wrong, Ive download so many javas now (as you can see) and now this is taking all my time to fix. I'm seriously thinking about dropping this course as I wont be able to finish my first friggin task in Java-programming since I have to google all day to solve this...
Best regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将 Java\jdk1.xx\bin 文件夹添加到 PATH 变量中。否则就行不通。另外,请确保您以设置 PATH 变量的用户身份使用控制台。问候
You need to add the Java\jdk1.x.x\bin folder to the PATH Variable. Otherwise it won't work. Also, make sure that you are using the Console as the User for whom you set the PATH Variable. Greets