How to determine if a JRE or JDK is installed

I have one computer on which I intentionally installed the JDK. I have another computer with a JRE for, among other things, testing. However, when I got a Java application running on this computer and then tried it differently, he complained that a JDK is required. How to check if JDK is installed on my system? Note: this computer is a Mac.

+79
java java-8 macos
Mar 20 '14 at 16:47
source share
2 answers

You can open a terminal and just type

java -version // this will check your jre version javac -version // this will check your java compiler version if you installed 

this should show you the version of java installed on the system (assuming you installed the java path in the system environment).

And if you didn’t, add it through

 export JAVA_HOME=/path/to/java/jdk1.x 

and if you don’t know that you have java at all on your system, just use find in the terminal

i.e. find / -name "java"

+101
Apr 24 '14 at 11:31
source share

Typically, a jdk installation has javac in the environment path variables ... so if you test javac in the path, this is a pretty good indicator that you have jdk installed.

+11
Apr 24 '14 at 11:21
source share



All Articles