I get an error trying to install Eclipse 4.7 (Oxygen) Oracle Corporation using the installer program, eclipse-inst-win64.exe Am I missing a system variable? Am I missing a prerequisite? This computer is locked down pretty tight. However I am installing by running as an administer.
First I installed the Oracle JDK 8.162 64-bit - No problems
Then I ran the eclipse-inst-win64.exe installer and quickly got the following error:
The Eclipse Installer executable launcher was unable to locate its companion shared library.
I thought this could be just that the program did not know where the JDK was installed. The JDK installer does not set any environment variables except for adding the path to the JDK to the PATH variable. So I searched StackOverflow for a list of JDK variables to add. I added the following new system variables:
CLASSPATH = .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_162
JAVA_TOOL_OPTIONS = -Dfile.encoding="UTF-8"
JDK_HOME = %JAVA_HOME%
JRE_HOME = %JAVA_HOME%\jre
I modified the Path variable to put the bin directory first:
PATH = %JAVA_HOME%\bin;C:\windows\system32;C:\windows… rest of the existing path variable
I ran the eclipse-inst-win64.exe installer again and got the same error:
I rebooted but still got this error.
I tried to "run as administrator" but got the same error.
Some people suggest that the path can get too long with the default installation directory so I tried installing the JDK in C:\JDK\ but still got the same problem.
Java seems to be installed properly:
H:>java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
I still assume that I made a mistake with my system variables or my JDK installation.
I assumed the "companion shared library" was inside the JDK installation. I extracted the installation files to another directory (C:\eclipse) and then it ran. The "companion shared library" must have been inside the zipped installer. I fixated on the idea that the problem had to be a failure to connect to the JDK that I did not consider any other possibilities. It is installed now.
Related
I have recently uninstalled JDK 11 and installed JDK 8. For confirmation, I want to check which JDK is installed on my Windows 10 machine. I typed java -version on cmd then get the error message
java is not recognized as an internal or external command
How to know which JDK version installed on my PC?
you might need to add path in environment variables which you can find in Control Panel
open the Jdk where you installed and add until /bin in the path in environment variables.
Add until /bin in path variable in System Variables which is residing in Environment Variables.
Then do
java -version
which might show up.
If still problem persists, try restarting your pc and see.
You need to update your Windows path to include your %JAVA_HOME%\bin directory. %JAVA_HOME% is the directory that you installed Java into and is also an environment variable that you need to configure for command line execution of your applications. You can edit both of these in the Windows control panel and you should restart.
When you run java -version you will see the internal version number. This is explained here: https://en.wikipedia.org/wiki/Java_version_history.
Basically, you can ignore the 1. when reading version number. The _xxx is a reference to the most recent patch or build release.
On Windows 10, this required mapping the environment variable for JAVA_HOME to the JDK installation directory. Use these steps:
Run the installer for the JDK. (available for windows here: https://www.oracle.com/java/technologies/downloads/#jdk17-windows)
windows key -> Environment Variables, select the only result
In the System Properties window that opened, select Environment Variables
Select new button under the User variables section
Variable name: JAVA_HOME, Variable Value: <The JDK filepath from step 0>
ok all open menus
Close any open cmd prompt windows
open a new cmd window and type echo %JAVA_HOME% It should print the installation path for the JDK.
To get your jdk location in Windows, run this at a command prompt:
where java
This lists any and all locations of java.exe, including from your JAVA_HOME. For example, the 3rd line here reflects my JAVA_HOME location, where I'm pointing to JDK 8:
C:\Users\me> where java
C:\Program Files\Common Files\Oracle\Java\javapath\java.exe
C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
C:\Program Files\Java\jdk1.8.0_202\bin\java.exe
Note for comparison that java -version does not reflect my JAVA_HOME location and in fact shows java version 11 instead of 8:
C:\Users\me> java -version
java version "11.0.15" 2022-04-19 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.15+8-LTS-149)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.15+8-LTS-149, mixed mode)
This is confusing because my Java compiles (e.g., via mvn) use JDK 8 since that's what my JAVA_HOME is pointing to. (I'm not even sure where the version 11 it found came from; possibly from when I installed maven.)
Determining the difference between the JRE and JDK you're running has never been straightforward. Seems like java -version used to be a way to do this, but no longer.
Adding to the complexity, you can also supposedly get your Java version info from Control Panel > Programs > Java > About. For me, that shows Version 8. That's despite java -version showing version 11.0.15. And it doesn't change even if I point my JAVA_HOME to JDK 11.
Note that this answer is also helpful. In my case, that helped me determine that I have java.exe and javac.exe at C:\Program Files (x86)\Common Files\Oracle\Java\javapath and C:\Program Files\Common Files\Oracle\Java\javapath. Depending on which one I have listed first in my Path variable, I get different results when i run java -version or java --version. The former seems to work when Java 8 is listed first; the latter when Java 11 is first.
I am beginner in linux (running Linux Mint 18.3), and trying to set-up my environment for Java development. I've done this several times on my Windows machine, and it always worked, but couldn't make it work for linux.
Running command java-version returns the following:
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)
Still, when I open IntelliJ, it says that Project SDK is not defined. When I am trying to set it up to the folder /usr/lib/jvm/java-8-openjdk-amd64/jre/bin (being the location I found digging into my filesystem starting with command whereis java) it says that "The selected directory is not a valid home for JDK". I've added manually the path also to $JAVA_HOME and '$PATH' but the problem persists.
The path you posted says "jre" in it, you need the JDK.
You need shoose JDK path
without BIN folder, like D:\java\jdk\jdk1.8.0_162
First of all, I know that this question has been asked before maybe more than once, like this one for instance Android Studio - No JVM Installation found but i couldn't know the path that i have to refered to.
i already installed jdk-8u31-windows-x64 and i am working on windows 7 64 bit, when i open Android Studio, i got message:
it seems obvious that i should add a JAVA_HOME system variable, but what is the value of that variable?
after installing jdk-8u31-windows-x64, i found this folder on my computer
C:\Program Files (x86)\Java\jre1.8.0_31, should I refered to it? or to the bin inside it? or should I install other stuff?
Note 1:
when I type java -version on my cmd, I got this:
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
Note 2:
Yesterday I formatted my laptop and installed the latest version of java from the official website of java
The JAVA_HOME should contain the path of the 64-bit JDK.
C:\Program Files (x86)\Java\jre1.8.0_31 is the path of a JRE. Normally the JDK directory should be something like jdk1.8.0_31 in your case, and the JAVA_HOME would store the absolute path of this directory, without the bin directory. Try searching for that directory under C:/Program Files (C:/Program Files(x86) is usually for 32-bit installations).
It would be better to also install JDKs in a path that does not have space.
I have two javas installed on my pc. jdk1.7.0_45 (x64) and jdk1.6.0_45(x86). I want that default java on my machine would be jdk1.6.0_45(x86). I added JAVA_HOME with value C:\Program Files (x86)\Java\jdk1.6.0_45 and added C:\Program Files (x86)\Java\jdk1.6.0_45\bin to system path, but still when i type in command prompt "java -version" it says:
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
I have no idea why the things are like that, because my OS should see jdk1.7.0_45 (x64) version. Why is that so?
I use windows 8
edit:
after setting java home to jdk1.7.0_45 (x64) folder and updating path accordingly javac works, but then I set java home and path to jdk1.6.0_45(x86) javac does not work.
You need to add the %JAVA_HOME%\bin to the very beginning of your path. This is because Java is installed in your %SystemRoot%\system32, too. If you add the %JAVA_HOME%\bin to the beginning of your path the Java installed in your JAVA_HOME will be used.
JAVA_HOME does not help when we run java from command line, you should fix PATH system var
I added JAVA_HOME with value C:\Program Files (x86)\Java\jdk1.6.0_45
In Windows, you should excape spaces in the path: JAVA_HOME="C:\Program Files (x86)\Java\jdk1.6.0_45". But the best way is to set Java to a folder that doesn't have spaces in its path. For example, I use C:\Java\Java6
and added C:\Program Files (x86)\Java\jdk1.6.0_45\bin to system path
Probably you added after path to the Java 7. Make sure that Java 7 doesn't exist in the system path.
Hi everybody.
The problem: elcipse-3.5.0 (Galileo) spits with an error when I try to launch it by clicking its launcher. The curse sound like this:
A Java Runtime Environment (JRE) or
Java Development Kit (JDK) must be
available in order to run Eclipse. No
Java virtual machine was found after
searching the following locations:
/home/emanemos/bin/eclipses/eclipse-3.5.0/jre/bin/java
java in your current PATH
However, everything goes smoothly when eclipse is started from console.
Before installing eclipse I've installed jdk1.6.0_16. I also created the $JAVA_HOME variable and changed my $PATH:
$ echo $JAVA_HOME
/usr/lib/java/jdk1.6.0_16
$ echo $PATH
/home/emanemos/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/java/jdk1.6.0_16/jre/bin
So that, my terminal got to know what java is:
$ java -version java version
"1.6.0_16" Java(TM) SE Runtime
Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build
14.2-b01, mixed mode, sharing)
Then a folder eclipse was extracted from .tar.gz package under the directory ~/bin/eclipses. I changed the folder's name eclipse to eclipse-3.5.0 and changed $PATH again:
$ echo $PATH
/home/emanemos/bin/eclipses/eclipse-3.5.0:/home/emanemos/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/java/jdk1.6.0_16/jre/bin
From this moment I was blessed to launch eclipse from console by the command eclipse.
However, I feel desperate about using the eclipse's application launcher.
Thanks in advance. I would be grateful for any help.
The message says "No Java virtual machine was found after searching the following locations: /Applications/eclipse/Eclipse.app/Contents/MacOS/jre/bin/"
I have solved it creating the folder /Applications/eclipse/Eclipse.app/Contents/MacOS/jre/bin and linking to the command at /usr/bin/java:
ln -s /usr/bin/java /Applications/eclipse/Eclipse.app/Contents/MacOS/jre/bin/java
Add this to eclipse.ini:-
-vm
$Java_home/jdk1.5.0_14/bin/javaw.exe
I could be off, but it looks to me that you don't have JAVA in your path. If you notice, you had to add it via the echo command. However, that only stays for that session of the terminal. You don't permanently affect the system. (I believe that's why you can launch from the terminal, but not via the launcher.)
Do you have the Java JRE actually installed on your system? If not, I would recommend doing that as that should do all the setup that you would need, then try running Eclipse again.
Edit: I noticed you said that you did install the 1.6 JDK. This should have fixed your problem. If Java is not in your path when you first open up your terminal, then that (I believe) is your real problem and you may need to do a reinstall or troubleshoot there.
(Making a big assumption that you're on Linux using X)
If you've installed the Java JRE without logging out and back in to the X session, the environment the session is in won't contain the $JAVA_HOME variable. It may just be a case of logging out and back in in order to get a new X session.
If you want to keep the same session running, you could try it out by pressing Ctrl+Alt+F9 to start another GUI session.
Fazil Baghirzade i solve the this problem
A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations:
c:\Program Files\Eclipse\jre\bin\javaw.exe 'javaw.exe' in your current path
go to the "C:\Program Files\Java\jdk1.6.0_39" in this folder have "jre" folder copy it and paste the eclipse folder
thats all!!!