开发者

Problem to access java.exe

开发者 https://www.devze.com 2023-03-01 14:34 出处:网络
Hy!! My Problem is that my terminal doesn\'t know the command java. So i will solve the problem to access the java.exe directly.

Hy!!

My Problem is that my terminal doesn't know the command java. So i will solve the problem to access the java.exe directly.

Code:

'C:\Program Files\Java\jre6开发者_如何学Go\bin\java.exe' -blabla

Exception:

Wrong Syntax

Please help


For your terminal to recognize command java you must put the entry C:\Program Files\Java\jre6\bin\ in your Environmental Variables in the variable called PATH.

To do so on Windows:

  1. Right mouse click on "My Computer" and select "properties"
  2. Go to Advanced tab
  3. In "Advanced" click on button "Environmental Variables"
  4. In "System Variables" edit PATH entry adding ; to the last entry
  5. Save and restart terminal

EDIT: To run it like you want you should use " instead of '. So your command will look like:

"C:\Program Files\Java\jre6\bin\java.exe" -version


You probably need to add the path to the installed JAVA code to your enviroment PATH variable. This will allow you to just type java.exe at the command line and have it find the executable without needing the full path. Then you could type java -help to see the options available.

0

精彩评论

暂无评论...
验证码 换一张
取 消