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
Related
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
I want to install an NPM express generator:
sudo apt npm install -g express-generator
It throws the following error:
Unable to locate an executable at "/Library/Java/JavaVirtualMachines/openjdk-14.0.1.jdk/Contents/Home/bin/apt" (-1)
I installed Java in this path (it's not in the System/Library/ - maybe thats the issue?):
'MacintoshSSD/Library/Java/JavaVirtualMachines/openjdk-14.0.1.jdk/Contents/Home'
My .bash_profile looks like that:
export JAVA_HOME=$(/usr/libexec/java_home)
If I check JAVA_HOME it looks fine:
echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/openjdk-14.0.1.jdk/Contents/Home
.. and Java version:
java --version
openjdk 14.0.1 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7)
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
Any idea why it still can find an exectuable?
I an other thread I read about a possible conflict between the pre-installed macOS Java-Version and the Orcalce Java-Version enter link description here but I couldn`t work it out..
And could you explain to me the difference between java_home and JAVA_HOME?
Sorry, I just saw what's wrong...
There used to be an apt tool in Java, but it's gone now. Your mistake is using the linux command line. On many linux systems, another tool called apt is used for installing software.
Check the npm documentation on how to install npm on your Mac, as there are different ways to do it.
Once npm is installed, run sudo npm install -g express-generator (no apt here).
Explanation of the error message
The Java apt-tool was removed in JDK 8. But as JAVA_HOME/bin is normally not on your PATH on Mac, apple provides simple wrappers for all the commands under JAVA_HOME. There still is such a wrapper for apt that tries to run a program with the same name from your Java installation. That's why you get that error message.
conflict between the pre-installed macOS Java-Version and the Orcalce Java-Version:
Apple stopped pre-installing Java in macOS 10.7 so this should not be an issue.
difference between java_home and JAVA_HOME:
JAVA_HOME is an environment variable that points to your Java installation. java_home is a utility program in macOS that makes it easier to correctly set up your JAVA_HOME by listing installed Java versions and the values to use for JAVA_HOME.
i have C:\Program Files\Java\jre1.8.0_102 and C:\Program Files\Java\jre7
and C:\jdk1.8.0_121 and in command prompt , java -version giving java version 1.8.0_102 that is fine. but when I type javac -version , it giving javac.exe not compatible with your windows. But no problem in other systems with same jdk and windows. please do help
javac.exe not compatible with your windows
Sounds like you've downloaded 64 bit JDK into C:\ but you're running 32bit Windows
The JRE does not contain javac, therefore the JDK is the problem
After you get a good version of Java, you'll need to fix your PATH variables
32 bit Windows on which a 32 bit JRE was already installed. You now tried to install a 64 bit JDK on it as well, which doesn't work.
The 32 bit JRE is still there, and as some installers will put java.exe and some others in your Windows installation (windows/system32 for example) they will get picked up instead of the JRE/JDK you just installed, even if you added that one to the system path as well.
That's why you're still seeing a correct response from java -version but not from javac -version, as javac.exe isn't copied there.
Remove the java*.exe from your windows installation, install a 32 bit JDK, set your JAVA_HOME correctly, and add %JAVA_HOME%\bin to your system path.
And oh, best not install a JDK to a place with spaces in the path, some versions don't like that.
Find out you set your environment variable correctly.
set JAVA_HOME=C:\jdk1.8.0_121
and entry to path -> %JAVA_HOME%\bin
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.
For the past few days I have been trying to install the JDK 7u10 which is made available by Oracle. after installing this JDK, I then proceed to install BlackBerry WebWorks SDK but i keep getting he following error message: "JDK 1.6 or higher not installed" what could possibly be the reason for this?
Create enviroment variables JAVA_HOME & JAVA_PATH and point them to 32 bit version JDK bin folder.
on a cmd prompt type: set JA
check if the variables have the right values.
javac -version and java -version should give you the good version, 32 bit!.
check if the enviroment variable PATH has not the location of 64bit path, if it has, correct it,
On the file BlackBerryWebWorksSDK.exe don't forget to enable compatibility with Windows XP (sp3). if you are running win8 or 7
The problems was that JDK needs to be installed as 32-bit, even in a 64-bit architecture.Try this
Is JAVA_HOME properly set? Are you able to run "javac" from the command line? What version of java does "javac -version" report?