0

I'm running in circles trying to figure out how the latest java JDK should be installed or upgraded to on the raspberry pi (it is currently using the original 1.8.0-b132 build).

I've found the java install for Arm v7 here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and downloaded it to the RPi, but not sure exactly what I need to do next. I assume I do something along the lines of this answer: How to install the Java JDK on Raspberry Pi but does this upgrade the old version? And does it take care of adding java to the global path? Is /opt/ the usual directory used for a newer version of java?

  • Yes, it should upgrade the old version. Well, not exactly upgrading but that tar file contains binary of the latest version and you're configuring system to use it by using update-alternatives. – dhruvvyas90 Oct 18 '15 at 5:11
1

does this upgrade the old version?

Not exactly, but if you follow the instructions in the answer you linked you will be using the updated version.

If you want to understand the purpose and function of update-alternatives, read man update-alternatives, which begins:

update-alternatives creates, removes, maintains and displays >information about the symbolic links comprising the Debian alternatives system.

It is possible for several programs fulfilling the same or similar functions to be installed on a single system at the same time. For example, many systems have several text editors installed at once. This gives choice to the users of a system, allowing each to use a different editor, if desired, but makes it difficult for a program to make a good choice for an editor to invoke if the user has not specified a particular preference.

Debian's alternatives system aims to solve this problem. A generic name in the filesystem is shared by all files providing interchangeable functionality. The alternatives system and the system administrator together determine which actual file is referenced by this generic name.

Read also about the --install and --config switches there.


And does it take care of adding java to the global path?

Yes.

Is /opt/ the usual directory used for a newer version of java?

It is for the Oracle package. The distro IcedTea java is elsewhere.

  • Full syntax is: sudo update-alternatives --config java – Kees de Kooter Dec 14 '16 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.