What java installation folders can I get rid of? - java

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

Related

Eclipse not working after deleting a version of 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.

Java program is slower as a dist build than when ran from Netbeans

So I have this neat physics sim I made that, while running at certain settings, runs at around 34 fps when ran via the Netbeans "run" -command. Then I click "clean and build" and go open the program from the dist folder, and it runs at around 10 fps with the same setup.
Can it be about Java settings? I don't have any special setting done in Netbeans but I'm not sure how to check my the settings on the installed JRE, can they even be different by default from what Netbeans uses by default?
I doubt it's running a different JDK but you can check the JDK that your Netbeans installation is using at Tools -> Java Platforms. To check what version of Java is in use by the distributed version look at your JAVA_HOME, and Path environment variables.
A major difference between the distributed version and the development environment may be the libraries. Check your CLASSPATH environment variable, and compare the actual files between the distribution and development environment to see that the size and dates match. I'm not totally sure how to get at the CLASSPATH used by Netbeans but can advise that it has some special magic it uses based on the libraries included. Also be aware that the order of the included libraries may make a differen
What software are you using to deploy your project?
Ok problem solved, it was due to outdated Java. I did have my 32 bit Java updated already - the default download at oracle.com but the program was using the 64 bit version, which was actually way outdated. So installing the latest 64 bit release of Java solved it.

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).

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)

How can I compile Java code in Windows without installing the whole JDK?

Let’s say the runtime environment (version 1.6.0_01-b06) is already in place, but since I lack administrative privileges in this particular PC, the JDK can’t be installed. So, is there any portable JDK or standalone Java compiler for Windows that doesn’t require installation?
You might try taking the tools.jar file from the JDK (you would have to copy it over from another machine) and see if that worked.
javac is essentially a small exe that starts the VM with the specific class for the compiler.
Also, there is nothing (that I am aware of) about the JDK install that you couldn't do with a copy of it from another machine. So get on a machine you can install the JDK on, install it, and then copy the files to a place on the machine that you lack the rights to and it should work.
You don't need to install JDK. Just copy it over from another machine, and set PATH to %jdk%/bin and JAVA_HOME to %jdk% (actually, only PATH is often enough). I do it all the time.
Eclipse works very well. being a portable ide, it will use it's own jdk. I personally use jGrasp w/ the jdk's folder as a PATH when I'm trying to write something quick.
You can try Jikes.

Categories