Reputation: 35702
Is it possible to tell if a JAVA_HOME
system environment variable contains a JDK within a Windows batch file?
Upvotes: 0
Views: 224
Reputation: 95518
If you're checking to see if the compiler exists, you could do something like:
if exist %JAVA_HOME%\bin\javac.exe (
...
) else (
...
)
Upvotes: 2
Reputation: 61526
You could look for %JAVA_HOME%\bin\javac.exe (or whatever it is, I assume exe). That should not exist in a JRE, only in the JDK.
Upvotes: 2