Appium Setup - Determining what jdk version I am using on mac - java

I am following a guide to set up Appium on my mac. It is asking me to set my JAVA_Home variables. They are using: export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home
They have instructed me to replace jdk1.8.0_192.jdk with my own version of JDK.
How would I find out what my JDK is?
I have tried using: java -version
java version "11.0.11" 2021-04-20 LTS
I am unsure how to translate that into the correct JDK.
Thanks in advance for any help

For the currently used jdk version;
/usr/libexec/java_home -V
You can use this command.

I was able to find the jdk version using the below command:
ls /Library/Java/JavaVirtualMachines

Related

Java -version error

I have installed JDK 1.8 on my ubuntu 16.04, for some kind of work I had to install JDK 1.7.I installed it without did anything to my older version and changed the $JAVA_HOME to point the newly installed location.
echo $JAVA_HOME works fine , showing newly installed version which is 1.7
but when I do $ java -version it shows earlier installed version which is 1.8.
Why does this happen? How to resolve it.
I need 1.7 to work with it further.
If I went wrong in somewhere please correct me,I need good explanation regarding this.
Thank you.
here is my terminal
Try to run following command in terminal:
$ sudo update-alternatives --config java
It shows installed alternatives for java command. You can choose which one you will use by default further on.

find rpm name from a executable

I am using redhat 6.5. By default JRE is installed with this OS. I want to find the rpm name of the jre installed in my machine.
ie) input should be executable and the output will be the rpm name
which java
/usr/bin/java
expected output:
command to find the rpm name.
jre-1.7.0_80-fcs.x86_64
here java --version shows version 1.5. But i want to use oracle jre instead of the default one. After installing oracle jre still the default version of jres is used but i want to remove the default version of jre from OS.
Any help will be appreciated.
The solution to you problem is , after installing the oracle version of java you have to use alternatives command to point to you default java, like follows:
# alternatives --config java
and select the default version there.
Now check the version of java with java --version

Where is JavaVirtualMachine installed on Mac?

I installed jvm 8 (8u45) on Mac 10.10, but running ./java_home -v 1.8 still get Unable to find any JVMs matching version "1.8".
java_home finds JVM 1.6 under path /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home, but there's nothing but 1.6. Where can I find jvm 8 on mac?
Thank you a lot.
It sounds like you've solved the issue by installing the JDK, but what probably happened initially was that you installed the JRE. You might find that installation at /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/, which you could check with
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

Setting Java home enviroment variable in OSX Mavericks

I am having issues with my Java path.
I have installed the latest version of Java 1.7.0_51. When I open the Java control panel it tells me "Your system has the recommended version of Java."
However when I go to terminal and type java -version I get
java version "1.6.0_32"
So after searching around I came across this SO Question which tells me that my Java home environment variable needs to be set.
I then opened the bash_profile file and added the below line to the top of the file, above my Python path info.
export JAVA_HOME=`/usr/libexec/java_home -v 1.7.0_51`
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
NOTE: I have tried this with both -v 1.7.0_51 and -v 1.7
I save the file and recheck in terminal but it is still showing
java version "1.6.0_32"
when I restart Terminal I do however see
Last login: Wed Feb 19 23:32:19 on ttys000
Unable to find any JVMs matching version "1.7".
localhost:/ user$
Note: Unable to find any JVMs matching version "1.7".
So it is trying to look for my 1.7, but just not finding it.
What am I doing wrong?
Check whether there is an old version existed in the path
echo $PATH
Then set the java 1.7 bin directory.
export PATH=/usr/libexec/java_1.7_home/bin:$PATH
Then try to type in "java -version" in terminal to check the version
Ok, I think this must be specific to me. As above the Java control panel was saying that java 7 was installed. Also when i tried
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
I would get
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
But no mater what way I installed the JDK it would not work. It just didn't seem to appear anywhere on my machine. I still don't know why, but uninstalling (by simply deleting the 1.6 folder) the existing Java 6 from my machine and once again installing Java 7 JDK eventually fixed it.
Please give the up-votes to #diaz994 above.

Neo4j 2.0 and Java compatibility

I am using neo4j 2.0.
echo $JAVA_Home shows me : /usr/lib/jvm/java-7-oracle/jre
java -version shows me : java version "1.7.0_25"
But When I starting my server then it shows me warning
WARNING! You are using an unsupported Java runtime. Please use Oracle(R) Java(TM) Runtime Environment 7.
What else does Neo4j want ??
Any help
Thanks
JAVA_HOME is not set to point to the a Java7 JRE.
On OSX, where I first noticed this problem, my JAVA_HOME is set in ~/.bash as
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`

Categories

Resources