簡體   English   中英

Javac 工作 java 不工作

[英]Javac works java does not

我被困住了。 我有 netbeans 工作,但是當我做命令行東西時,javac 工作但 java 沒有。

我在命令行得到這個

錯誤:找不到 java.dll

錯誤:找不到 Java SE 運行時環境。

在 PATH 我有

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

我不知道此時該怎么辦。

我的批處理文件在我的另一台計算機上運行,​​但不是這個

SET CLASSPATH = .;
javac *.java
java Main
pause
del *.class

我想這是開始使用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/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM