![]() So, whenever a command prompt is opened, it automatically loads profile.bat, which creates those two alias in the script. Here, please put your actual path value to the profile.bat we just created. Give AutoRun as the Value name and %USERPROFILE%\profile.bat as the Value data. Every time, java8 or java9 is called, it re-exports %PATH% with the new JDK path. In batch file any string after :: is the comments. In order to switch JDK version in cmd, here's the trick.ĭOSKEY java8=SET PATH=%JAVA_8_HOME% %PATH% ĭOSKEY java9=SET PATH=%JAVA_9_HOME% %PATH%īasically, it disables echo and creates two alias. %JAVA_HOME% will be added to PATH automatically every time you launch a command prompt. That's my preference, feel free to adjust accordingly. %JAVA_HOME% has a default value pointing to JAVA_8_HOME, which is the path for JDK8. ![]() You can replace this with your own path to javac. In my case, JAVA_8_HOME(JDK8) is pointing to C:\Program Files\Java\jdk1.8.0_152\bin. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |