Install jdk without sudo?

I currently have a machine that I work on in Eclipse, it says that the version of the JRE System Library is sun-jdk-1.5.0.11, but on my active development machine it is java-6-sun-1.6. 0.16. Is there a way to force the first machine to use the same version of "java-6-sun-1.6.0.16" without sudo permission on the machine?

+4
source share
2 answers

You can install the JDK in a non-standard directory, for example, in your home directory without special permissions.

You just need to specify PATH, JAVA_HOME and Eclipse.

+5
source

The great thing with Java on Linux (and completely different Unices) is that you don't need a β€œroot” password to set it up. I do this all the time. This contrasts sharply with Windows, where the last time I checked, it was impossible to install Java without an administrator password.

All you need is a repertoire in which you put the JRE (or JDK) and then put it in the path:

... $ export PATH=~/jdk1.6.0_17/bin:$PATH ... $ which java /home/wizard/jdk1.6.0_17/bin/java ... $ java -version java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04) Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode) 

In the same vein, you can save multiple JVMs in one user account and simply change the path as necessary (or point your IDE to the correct JVM: for example, I run IntelliJ IDEA with 1.6 VM, but compile and run all my unit tests with using 1.5 VM).

+4
source

Source: https://habr.com/ru/post/1305627/


All Articles