2

In another question here (Minimal Java installation for Linux with no GUI) I found some information about headless installation of OpenJDK, but I would need this with Oracle Java 8.

  • I need Oracle Java, because I use an ARM architecture (Raspberry Pi 2) to run a Minecraft Spigot server, and red many times that ARM version of OpenJDK lacks critical optimalisation to provide suitable performance

  • I want version 8, because Spigot also recommands to use this version for any Minecraft-related purpouses; OpenJDK does not have version 8 yet anyway

  • I want it headless, since I run my Raspberry server in console mode, with all GUI/desktop environment components uninstalled, to save storage place and performance.

My current system is the strongly Debian-based Raspbian Wheezy (Kernel ver. 3.18.; released 2015-05-05). This comes with a pre-installed Oracle Java 8, but it was deleted when I wiped out the GUI and desktop components (along with various other useless softwares) to make a minimal platfrom.

Then I tried to re-install it using the following command:

# apt-get install oracle-java8-jdk

it provided me a huge list of packages to install, which, as I was able to recognize them, contained mostly fonts, icons, language files, and x11 (x-server-realted) libraries, all nice damned GUI staff, what I absolutely do not need - and cried for >200 MB storage space.

Finally to my question: is there any way to install an Oracle Java Runtime Environment without these GUI conponents? Maybe I should manually sort out unwanted packages - but how could I know which ones are really need for Java to run on console, or may it cause instability if I miss packages which are in the dependancy list, but functionally would not need to Java?

The list of required packages (maybe they will help):

fontconfig fontconfig-config hicolor-icon-theme libatk1.0-0 libatk1.0-data libcairo2 libdatrie1 libfontconfig1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgraphite2-2.0.0 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libharfbuzz0a libjasper1 libjpeg8 libpango-1.0-0 libpango1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpangox-1.0-0 libpangoxft-1.0-0 libpixman-1-0 libthai-data libthai0 libtiff4 libx11-6 libx11-data libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxft2 libxi6 libxinerama1 libxrandr2 libxrender1 libxtst6 oracle-java8-jdk ttf-dejavu-core x11-common

  • I'm assuming you won't need the JDK, it's the development kit, what you need is the runtime, what about java-runtime-headless? Does that work? – ZN13 Jan 1 '16 at 21:59
0

Full JDK (no matter if oracle-java8-jdk package, or JDK straight from Oracle) contains VisualVM profiler. It runs in graphical mode, which explains these dependiences.

You wrote about storage space, that >200MB is too big for you. And you also don't indicate, why you need full JDK, instead of just JRE, which is perfectly enough to run software written in Java.

So, I suggest to use this:

https://github.com/serverfarmer/sf-java8

setup.sh file installs plain JRE from Oracle, in /opt directory. And it:

  • makes a symbolic link /opt/java, which will always lead to current Java installation
  • adds proper JAVA_HOME and JAVA_OPTS environment variables to /etc/environment file, so many Java-based software (eg. Tomcat, JBoss EAP) will be able to find it automatically, without any manual configuration
  • You definitely got the point: I probably wont need development components of JDK (though users have to compile Spigot server to create the java byte code, but this can be done on other machine). I was only intended to install oracle-java8-jdk package, because it seemed the only java-related package in depository. – dietweiler Jan 2 '16 at 12:38
  • But: when I examined your script, which seemed to solve the problem, I found that it can only download Java versions only for ordinary x86 and x64 architectures, but not for ARM architecture. (Raspberry Pi contains an ARM type CPU, mostly used in mobile devices, to ensure low power requirement.) Additinally, I cannot find a standalone JRE for ARM on Oracle website. – dietweiler Jan 2 '16 at 12:44
  • Ok, I get it. Unfortunately there is no JRE for ARM, only full JDK, and its latest version is 8u65 instead of 8u66: oracle.com/technetwork/java/javase/downloads/… – Tomasz Klim Jan 2 '16 at 15:09
  • After you download and extract the full JDK you should be able to get rid of some of it manually, since the JRE is kept in a sub-directory. – ivanivan Nov 11 '18 at 17:49

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.