我被困住了。我有netbeans工作,但是当我执行命令行操作时,javac可以工作,但是java却不能。
我在命令行
错误:找不到java.dll
错误:找不到Java SE运行时环境。
我拥有的
C:\ Program Files(x86)\ Common Files \ Oracle \ Java \ javapath
C:\ Program Files \ Java \ jdk C:\ Program Files \ Java \ jre
Java_Home是
C:\ Program Files \ Java \ jdk
我现在不知道该怎么办。
我的批处理文件在其他装有Java的计算机上运行,但没有运行
SET CLASSPATH = .;
javac *.java
java Main
pause
del *.class
答案 0 :(得分:0)
我想这是开始使用Java时的常见问题。
从上面的评论看来,安装jdk后您似乎没有正确设置类路径。
Here are the steps to do it: 1. in run dialog box, type sysdm.cpl 2. go to system properties->advanced->environment variables 3. click new button under system variables window 4. In the new System Variable window, set the Variable name to JAVA_HOME and the Variable value to the path to your JDK directory (so this would be C:\Program Files\Java\jdk in the system of the questioner. then click ok. 4. Find the variable called Path under system variables and click edit 5. Then click NEW in the edit environment 6. Name the new variable %JAVA_HOME%\bin 7. click and enter and ok.
咨询资源:https://appuals.com/fix-javac-is-not-recognized-on-windows-10/