This issue is annoying when dealing with multiple JDKs for developing on Windows 10 (I couldn't make use of the OS system path change as suggested here).Īs a partial answer (since this might not be intended as 'properly' installed) I'm doing quite fine using Cygwin to switch JAVA_HOME and run Maven builds with different JDKs (1.7,1.8) installed (via Oracle installers). If not %_err%=0 set _javabin=%_javabin% %~1Įcho No JDK matching found.įor /F "tokens=2,3 delims=." %%a in ("%_jdkdir%") do set _jdkver=1.%%a.%%b offįor /D %%f in ("C:\Program Files\java\"jdk1.%_version%.*) do call :found "%%f" You might have to edit the installation location for Java. This is understandable with the JRE, but it's crazy with JDKs, as developers almost always need multiple versions of Java.ĮDIT: I find this batch script is useful for switching JDKs. Oracle, it seems, are determined to make it hard to run multiple versions. I can now switch versions by pointing JAVA_HOME and PATH to the appropriate folders. I've deleted the system32 files and removed C:\programdata\Oracle\Java\javapath from the system path. This folder contains java.exe, javaw.exe and javaws.exe as symlinks to the JRE 8 executables. The system path variable starts with C:\programdata\Oracle\Java\javapath. Your path probably has system32 near the beginning, so these tend to be run by default. \windows\system32 contains Java 8 java.exe, javaw.exe and javaws.exe. The problem is that Java 8 installs a lot of stuff that you don't really need:
0 Comments
Leave a Reply. |