How to add `java` to the command path in Vista?

I have JDK installed in Vista. I want to run javafrom the command line. How to set up a path variable?

If I canโ€™t set the variable JAVA_HOME, what is the alternative?

+3
source share
7 answers

Open my computer -> General settings -> Environment variables and add global

Key: JAVA_HOME Value: C: \ jsdk etc. Etc.

And then change the Path variable

Value (enter at the end)

 ....something;something;something;%JAVA_HOME%\bin

Open a command prompt and enter

 javac 

And see if it works

EDIT

Moved my comment to answer

, .

, , jdk C: "Program Files"

C: "" :

  C:\jdk1.6.0_14\bin\javac

 C:\Program Files\Java\jdk1.6.0_14\bin\javac

: C:\Program " " - .

C:

+4
0

java- , ;

c:> java -classpath somedir com.example.Main

java ,

c:> SET JAVA_HOME=c:\path\to\java
c:> <same java stuff from above>
0

-classpath java, , .

classpath - , JAR ZIP-, , , . , : Windows ";" , ":" .

CLASSPATH , .

0

Vista , %JAVA_PATH%, JAVA_PATH .

, %JAVA_PATH% c:\program files\Java\<whatever>, c:\program files\Java\<whatever>\bin Path Vista.

0

" ", " " โ†’ "" โ†’ " " ( " " ) โ†’ "" โ†’ " ". .

0

Source: https://habr.com/ru/post/1716136/


All Articles