Reputation: 1856
So I am new to using and creating batch files. I was wondering what is wrong with my file. I want to make it where it sets the path so I can compile my java file in cmd. Here is my code
@echo off
:start
rem set path="c:\Program Files\java\jdk.1.8.0_102";
set path=%path%;c:\Program Files\java\jdk.1.8.0_102
cls
pause
rem goto start
I am not to sure which one is right between the 2 paths so I was just testing.
Upvotes: 1
Views: 22667
Reputation: 1
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_202
set PATH=%PATH%;%JAVA_HOME%\bin
Set the Java home and path like this. It worked for me
Upvotes: 0
Reputation: 36
setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0"
setx PATH "%PATH%;%JAVA_HOME%\bin";
JAVA_HOME: stores location of the JDK’s installation directory. PATH: stores paths of directories where the operating system will look, to launch the requested programs quickly.
Upvotes: 2