Tuesday, July 25, 2017

java - JDK/JRE explanation of comands for install

Maybe this is a simple question.


I don't find the explanation of the commands for install Java JDK and JRE


I downloaded the jdk-7u5-linux-x64.tar.gz and jre-7u5-linux-x64.tar.gz,
I extracted these files and then moved to /usr/lib/jvm/. Whell I guess that the name /jvm (I created that beacause I don't had it) is not important beacause the installation is by link.


Most webs tell me that I have write that but they not explain why.


I guess that this create a java's link in /usr/bin/


/usr/bin/java -> /etc/alternatives/java -> /usr/lib/jvm/jdk1.7.0_05/bin/java


sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0/bin/java 1

/usr/bin/java ==================> is the final link


java ========================> I don't understand why I have to write that


/usr/lib/jvm/jdk1.7.0_05/bin/java ==> original file


1 ===========================> why 1? some people write 2, 3 or I saw 2000!


the same in java, javac and javaws. And the same in JRE, but when I install JRE, th link is replaced


sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 2

and when I choose sudo update-alternatives --config java I can only choose one, so what is the difference between jdk/bin/java and jre/bin/java (they are the same version)


Can anyone explain me that in a simple way? because I'm beginner in that, I don't know nothing of java, I only need these javas for other program that use it


Can anyone send me a good page for the correct installation of both, please.


Thanks

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...