I'm trying to install JDK on elementaryOS 0.3, but I'd like to do it in a FHS-compliant way. I've read a couple of answers about this topic, and a lot of them state that a program could be installed in /usr/local/. I was going to create a java folder in /usr/local, but before to do that, I started to read the FHS 3. It said the following:

4.9.2. Requirements

The following directories, or symbolic links to directories, must be in /usr/local

Directory Description

  1. bin Local binaries
  2. etc Host-specific system configuration for local binaries
  3. games Local game binaries
  4. include Local C header files
  5. lib Local libraries
  6. man Local online manuals
  7. sbin Local system binaries
  8. share Local architecture-independent hierarchy
  9. src Local source code

No other directories, except those listed below, may be in /usr/local after first installing a FHS-compliant system.

This means that I have to unzip the JDK file and put, for example, the JDK's bin folder inside of /usr/local/bin, JDK's manuals in /usr/local/man, and so on with the other folders?

  • Why not just install those packages your distro provides? – Braiam Jun 19 '15 at 21:45
  • Most distributiond install the java packages from their respective repositories (as Braiam suggests) in the /opt directory which is FHS compliant... Each user gets their source code in a centralized location. – eyoung100 Jun 20 '15 at 1:07

Given that elementary OS is based on Ubuntu, you have a couple of options.

  1. You can install OpenJDK using the openjdk-7 or openjdk-8 packages; I'm not sure the latter are available in elementary OS though.

  2. You can re-package an Oracle JDK (including JDK 8) using the java-package package which is also available in elementary OS. This will give you an FHS-compliant package which will also integrate nicely with the Java alternatives system which is used in Debian derivatives.

| improve this answer | |

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.