Eclipse not working after deleting a version of java - java

I found out I had the JRE and the JDK on 2 different folders, I then deleted the JRE. The JRE is still here in the JDK install.
I then searched a bit about the problem. I created the environment variable (I am on W10) JAVA_PATH with the good path but it still doesn't work.
A dialog box says (I can't copy paste all) :
JVM terminated
C:\ProgramData\Oracle\Java\javapath\javaw.exe
(lots of things)
I don't know how to get it working.

Reinstalling your JRE will solve the problem. If you want to get rid of some software always deinstall it if possible because you don't know where all of the files and settings were installed.

you will need java, if you have a JDK the a JRE is included there by default..., maybe you had 2 version of java and you still have a jdk, so lets say you deleted the jre, then you need to tell the eclipse IDE that it must use the version you have installed and where it can find it..
How:
like this...
but now, if you deleted ALL the java versions then you will need to install at least one...

You should have defined your environment variable as JAVA_HOME and assign it your JDK's path. Then, add this variable to your PATH variable as JAVA_HOME/bin.

Related

JRE and JDK Paths

I am currently learning coding and Java. I have done lots of research on this topic but I just can't seem to understand it. So I have the JDK 9.0.1 and JRE 9.0.1. As you can see here I have the JRE and JDK 9.0.1 in my Programs and Files folder in my C drive/ SSD:
I am trying to figure out how to add both the JRE and JDK to the Environment Variables. I have tried numerous things but sometimes I can only get one or the other to work (i.e. java working in CMD but not javac). This is currently what my variable looks like.
I have tried doing the semicolon then put my other JDK bin folder path but it didn't work. Any suggestions?
Assuming you intended to ask about "Java" as opposed to "javascript", there is no need to have both the jdk and the jre. The jdk contains the jre.

What java installation folders can I get rid of?

My machine runs Windows 64 bits. I have multiple IDEs installed (eclipse, intelliJ, qt creator, visual studio) and I daily run some work applications that use java (vpn connector being the most important one).
Usually, when I get a java update notification I just accept and everything runs smoothly, but today I found that Eclipse is not starting because of exit error 13, which I read is caused by 32-bit/64-bit conflicts between Eclipse and Java. When I checked my java installation folders, I found out I have multiple folders, both for 32 bits and 64 bits:
I'm not even sure how those JRE folders ended up there, since I only download the JDK when I have to. Maybe they are the JRE installed with JDK but not sure.
Anyway, this is my 32-bit JAVA folder:
And this is my 64 bit-JAVA folder:
How can I get rid of all of those safely, download and install the latest JDK afresh and have everything running smoothly?
Thanks :)
The safest way remove Java installations on Windows is to run the respective uninstaller via the control panel. In addition to deleting the installations themselves, the uninstaller will (should) remove related entries from the Windows registry.
As other answers note, you would still need to ensure that the JAVA_HOME environment variable is updated to refer to the new Java installation, once you have installed it.
However, the problem with uninstalling copies of Java that you didn't explicitly install yourself is that you may end up breaking tools and applications that depend on those copies. If the tools use JAVA_HOME you should be fine. Otherwise, you might need to modify launcher scripts, etcetera.
If you are worried about this, you could rename the Java installations that you intend to remove, launch each of the apps, and see which of them breaks. (Then rename the Java installations back ...)
I had a problem like this before (with a lot of version and JDKs installed).
The best way is just to delete everything and download it again, i know that it isn't the best solution and it will take some time to download and install everything again but it worked for me before.
It does not matter how many jdk/jre folders you have. Just make sure environment variable JAVA_HOME and JRE_HOME points to the 64 bit jdk and jre folders correspondingly. You can remove other folders which are not pointed. The other applications may break after this change. You can fix them by pointing to this JAVA_HOME.
Refer this for setting JAVA_HOME env variable

How to install multiple versions of JDK without destroying current settings?

I'm on an Ubuntu Desktop that is set up with JDK 1.6.34 and everything works great. I'd like to install JDK 1.5.11 in such a way that my environmental variables, etc. don't get "blown out" by the installation of 1.5.11.
Is this even possible? Can the same machine have 2+ JDKs installed on it? If so, what are the necessary steps one needs to take to achieve this?
Yes, you can install as many JDK's on a machine as you want. As for "blowing out" environment variables, this is how you control which jdk you'll use (i.e. make sure the desired jdk's /bin directory is first in the path and that JAVA_HOME points to the JDK you want to be using).

Android SDK and Java

Android SDK Manager complains "WARNING: Java not found in your path".
Instead of using the information from Windows registry, the software tries to search Java in the default installation folders, and fails (I don't install software in program files because I don't like space characters in my paths). Of course I know how to modify the %PATH% environment variable. The question is — which Java does it need?
After installing the latest JDK, I’ve got 4 distinct versions of java.exe file, in the following 4 folders: system32, jre6\bin, jdk1.6.0_26\bin, and jdk1.6.0_26\jre\bin. Size ranges from 145184 to 171808. All of them print version “1.6.0_26” when launched with the “-version” argument. The one in system32 has .exe version “6.0.250.6”, the rest of them is “6.0.260.3”. All 4 files are different (I’ve calculated the MD5 checksums).
Q1. Which folder should I add to %PATH% to make the Android SDK happy?
Q2. Why does Oracle build that many variants of java.exe of the same version for the same platform?
Thanks in advance!
P.S. I'm using Windows 7 SP1 x64 home premium, and downloaded the 64-bit version of JDK, jdk-6u26-windows-x64.exe.
jre6\bin should work. That's what I put in %PATH%.
JRE is the Java Runtime Environmen and JDK is the Java Development Kit).
jre6\bin comes from JRE.
jdk1.6.0_26\bin has the development kit binary files
jdk1.6.0_26\jre\bin has an implementation of the Java Runtime Environment for use by the JDK
Please see Contents of the JDK for more info
Try setting JAVA_HOME pointing to the jdk1.6.0_26 directory. See this post.
Actually I got stuck in this same problem, and although that the above answer should work properly... it didn't work for me.
The only solution that fixed this problem for me is copying the installed jdk folder to folder C:\Program Files\ ... and name that folder Java!
I know that this doesn't make any sense! but that what solved my problem after it make me go crazy.
I hope the normal solutions would help your problem, otherwise; you might think of my ugly solution and I hope your problem gets fixed soon.
Thanks,
Mohamed A.Karim.
What helped me was changing one of Enviroment Variables (right-click on "my computer" then "Advanced system settings" or similar) named PATH. Using function "edit" i added this:
C:\Program Files\Java;C:\Program Files\Java\;C:\Program
Files\Java\jdk1.6.0_29;C:\Program Files\Java\jdk1.6.0_29\;C:\Program
Files\Java\jdk1.6.0_29\bin;C:\Program Files\Java\jdk1.6.0_29\bin\
(one of those is sufficient, but I don't know which).
I have Windows Vista 32bit.
replace "program files' with "progra~1" in your path
I have the same problem, maybe because I installed JDK on E: instead of C:
Solved by creating a run.bat file with these:
set JAVA_HOME="E:\Program Files\Java\jdk1.6.0_26"
set PATH=%PATH%;"E:\Program Files\Java\jdk1.6.0_26\bin"
call "sdk manager.exe"
Works perfectly
Perhaps the path did what I needed

download jdk1.5.0_18 source code

I'm looking for the JDK source code for Java 1.5 update 18 (on win XP). I don't want to install a JDK, I don't want the source code for the entire VM, just the source for the JDK libs, so that when I navigate to a Java class in Eclipse, it opens up the source code.
Is it possible to download just src.zip (or a zip that contains src.zip)? I don't want to install a new JDK/JRE just to get access to src.zip as I'm concerned that this will have undesirable side-effects such as modifying JAVA_HOME.
Thanks,
Don
The best place to go to get old versions of Java stuff is the Archive page. JDK 1.5.0_18 is there.
However, I don't think it is possible to download just the source code ZIP file. But hey, you could always get a friend to download the relevant JDK and copy it onto a CD/DVD for you.
EDIT re your concern about environment variables being changed.
Installing a JDK does not modify the JAVA_HOME environment variable or any other environment variable. Indeed, the JDK / JRE installation instructions explain that you need to update JAVA_HOME and PATH manually.
Sun have always been careful to allow you to install multiple JDK/JREs side-by-side. The only thing of that nature that gets changed by the installer is the version of Java used by your browser's Java plugin. And that only changes if you give the installer permission to change it!!
Below is the source for the latest JDK 1.5 but it seems difficult to find update 18 specifically, at least there is no obvious link :-(
http://java.sun.com/j2se/jrl_download.html
Only place I know of that you can get them is with the JDK. You can grab it here
Installing it shouldn't modify JAVA_HOME
http://download.java.net/jdk6/source/
Is that what you want?
Download the JDK for the release you want to use, and install it.
Then start Eclipse and go to Window -> Preferences -> Java -> Installed JREs, and Add the JDK you just installed, and ensure it has the checkmark!
That should do it (and it doesn't mess with the default java versions and JAVA_HOME and all)

Categories