Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Headless with Oracle Java: An epic adventure
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
sixstringsalve
n00b
n00b


Joined: 16 Aug 2015
Posts: 2

PostPosted: Sun Aug 16, 2015 6:28 am    Post subject: Headless with Oracle Java: An epic adventure Reply with quote

I just thought I would share my experience with this here incase anyone else runs into the same issues.

Headless - because it's only going to run a backup server and be used for learning C and C++. And maybe also because it's a 700Mhz celeron coppermine CPU with 512MB of RAM :roll:

Java - because I'd like to learn JAVA and I'm curious if I can get a useful vanilla minecraft server running on this hunk of junk

The gentoo install itself was fairly uneventful but when I attempted to install Java using "emerge --ask dev-java/oracle-jre-bin" it tries to pull in a bunch of x11 stuff even though I have -X -kde -gtk etc. in make.conf and no amount of -flags would get me to a point that it would only install Java and it's dependancies without the x11 junk I don't want. This has been something about Gentoo I never really understood. It needs a portage profile for "Server/Headless" so that users don't have to spend a day and a half trying to solve something that should really be able to be solved with one or two configuration options. I digress. Moving along.

This is what it wanted to merge:

Code:
Gentoo portage # emerge --ask dev-java/oracle-jre-bin

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] media-fonts/liberation-fonts-2.00.1-r1  USE="-X -fontforge"
[ebuild  N     ] app-eselect/eselect-java-0.1.0
[ebuild  N     ] sys-apps/baselayout-java-0.1.0
[ebuild  N     ] dev-java/java-config-wrapper-0.16
[ebuild  N     ] virtual/ttf-fonts-1
[ebuild  N     ] x11-proto/xproto-7.0.27  USE="-doc"
[ebuild  N     ] x11-proto/xextproto-7.3.0  USE="-doc"
[ebuild  N     ] x11-proto/inputproto-2.3.1
[ebuild  N     ] x11-misc/util-macros-1.19.0
[ebuild  N     ] media-fonts/font-util-1.3.0
[ebuild  N     ] dev-java/java-config-2.2.0  PYTHON_TARGETS="python2_7 python3_4 -python3_3"
[ebuild  N     ] x11-proto/renderproto-0.11.1-r1
[ebuild  N     ] x11-proto/xf86bigfontproto-1.2.0-r1
[ebuild  N     ] x11-proto/kbproto-1.0.6-r1
[ebuild  N     ] x11-libs/xtrans-1.3.5  USE="-doc"
[ebuild  N     ] dev-libs/libpthread-stubs-0.3-r1  USE="-static-libs"
[ebuild  N     ] x11-proto/xcb-proto-1.11  PYTHON_TARGETS="python2_7 python3_4 -python3_3"
[ebuild  N     ] x11-proto/fixesproto-5.0-r1
[ebuild  N     ] x11-libs/libXdmcp-1.1.1-r1  USE="-doc -static-libs"
[ebuild  N     ] x11-libs/libXau-1.0.8  USE="-static-libs"
[ebuild  N     ] x11-libs/libxcb-1.11-r1  USE="-doc (-selinux) -static-libs {-test} -xkb"
[ebuild  N     ] x11-libs/libX11-1.6.2  USE="ipv6 -doc -static-libs {-test}"
[ebuild  N     ] x11-libs/libXext-1.3.3  USE="-doc -static-libs"
[ebuild  N     ] x11-libs/libXrender-0.9.8  USE="-static-libs"
[ebuild  N     ] x11-libs/libXfixes-5.0.1  USE="-static-libs"
[ebuild  N     ] x11-libs/libXi-1.7.4  USE="-doc -static-libs"
[ebuild  N     ] media-libs/fontconfig-2.11.1-r2  USE="-doc -static-libs"
[ebuild  N     ] app-eselect/eselect-fontconfig-1.1
[ebuild  N F   ] dev-java/oracle-jre-bin-1.8.0.51  USE="awt fontconfig -alsa -cups -javafx -jce -nsplugin -pax_kernel (-selinux)"

Fetch instructions for dev-java/oracle-jre-bin-1.8.0.51:
 * Please download 'jre-8u51-linux-i586.tar.gz' from:
 * 'http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html'
 * and move it to '/usr/portage/distfiles'
 *
 * If the above mentioned urls do not point to the correct version anymore,
 * please download the files from Oracle's java download archive:
 *
 *    http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html#jre-8u51-oth-JPR
 *

The following license changes are necessary to proceed:
 (see "package.license" in the portage(5) man page for more details)
# required by dev-java/oracle-jre-bin (argument)
>=dev-java/oracle-jre-bin-1.8.0.51 Oracle-BCLA-JavaSE

Would you like to add these changes to your config files? [Yes/No] n


What I eventually did to solve this was exclude any X related packages from portage using instructions from:
https://forums.gentoo.org/viewtopic-t-356536.html

My rsync_excludes file looks like this:

Code:
# prevents portage from using the following parts of the tree

gnome*-/
kde-*/
lxde-*/
lxqt-*/
x11-*/
xfce-*/



I also removed the corresponding directories from /usr/portage/profile using

Code:
rm -rfv gnome* kde* lxde* lxqt* x11* xfce*


And did:
Code:
env-update
although I don't know if that was necessary


Now USE flags to remove anything to do with X are not even needed. I can comment out the USE line in my make.conf and still not pull anything related to any graphical interface and my emerge --ask dev-java/oracle-jre-bin now looked like this:

Code:
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] app-eselect/eselect-java-0.1.0
[ebuild  N     ] dev-java/java-config-wrapper-0.16
[ebuild  N     ] sys-apps/baselayout-java-0.1.0
[ebuild  N     ] dev-java/java-config-2.2.0  PYTHON_TARGETS="python2_7 python3_4 -python3_3"
[ebuild  N F   ] dev-java/oracle-jre-bin-1.7.0.80  USE="-X -alsa -fontconfig -jce -nsplugin -pax_kernel (-selinux)"

Fetch instructions for dev-java/oracle-jre-bin-1.7.0.80:
 * Please download 'jre-7u80-linux-i586.tar.gz' from:
 * 'http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html#jre-7u80-oth-JPR'
 * and move it to '/usr/portage/distfiles'
 *
 * If the above mentioned urls do not point to the correct version anymore,
 * please download the files from Oracle's java download archive:
 *
 *    http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jre-7u80-oth-JPR
 *

The following license changes are necessary to proceed:
 (see "package.license" in the portage(5) man page for more details)
# required by dev-java/oracle-jre-bin (argument)
>=dev-java/oracle-jre-bin-1.7.0.80:1.7 Oracle-BCLA-JavaSE

Would you like to add these changes to your config files? [Yes/No] y

Autounmask changes successfully written.




The is still a problem though, you have to manually create the /etc/portage/package.license file and put the following lines in it:

Code:
# required by dev-java/oracle-jre-bin (argument)
>=dev-java/oracle-jre-bin-1.7.0.80:1.7 Oracle-BCLA-JavaSE


EDIT: I just discovered that a file name "._cfg0000_package.license" is being created for this. So you just need to
Code:
# ls -a
# cat ._cfg0000_package.license >> package.license && rm ._cfg0000_package.license

to copy the contents of ._cfg0000_package.license to package.license and then remove ._cfg0000_package.license..

So now the output looked like this:

Code:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] app-eselect/eselect-java-0.1.0
[ebuild  N     ] sys-apps/baselayout-java-0.1.0
[ebuild  N     ] dev-java/java-config-wrapper-0.16
[ebuild  N     ] dev-java/java-config-2.2.0  PYTHON_TARGETS="python2_7 python3_4 -python3_3"
[ebuild  N F   ] dev-java/oracle-jre-bin-1.7.0.80  USE="-X -alsa -fontconfig -jce -nsplugin -pax_kernel (-selinux)"

Fetch instructions for dev-java/oracle-jre-bin-1.7.0.80:
 * Please download 'jre-7u80-linux-i586.tar.gz' from:
 * 'http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html#jre-7u80-oth-JPR'
 * and move it to '/usr/portage/distfiles'
 *
 * If the above mentioned urls do not point to the correct version anymore,
 * please download the files from Oracle's java download archive:
 *
 *    http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jre-7u80-oth-JPR
 *

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests

>>> Emerging (1 of 5) app-eselect/eselect-java-0.1.0::gentoo


Hey! We're on our way! BUT... there is another bump in the road in the form of a corrupt tar.gz download from Oracle (thanks to a google chrome bug). So I used IE to download it (yea yea... )

The final problem was due to file permissions/ownership since the file had to be manually copied to the /usr/portage/distrofiles directory using the root account. That was easily solved with

eyoung100 wrote:
who owns /usr/portage/distfiles and var/tmp/portage

try:
Code:
chown -R portage:portage /usr/portage/distfiles/jre-7u45-linux-x64.tar.gz
chown -R portage:portage /var/tmp/portage


which gives portage ownership of the file.

After that it installed with no issues at all and I was even able to fire up a minecraft server! A very poor server that kicks users because it thinks they are floating but I still consider this a success! :lol:



BTW, first post here. Hi everyone!


Last edited by sixstringsalve on Sun Aug 16, 2015 7:16 am; edited 2 times in total
Back to top
View user's profile Send private message
heiwa
n00b
n00b


Joined: 24 Oct 2012
Posts: 70

PostPosted: Sun Aug 16, 2015 6:45 am    Post subject: Reply with quote

I think USE="-fontconfig" would have been enough to prevent it pulling the X stuff.
Back to top
View user's profile Send private message
sixstringsalve
n00b
n00b


Joined: 16 Aug 2015
Posts: 2

PostPosted: Sun Aug 16, 2015 6:53 am    Post subject: Reply with quote

I tried that but it still wanted to pull everything x11-* related. I figured since I'm never going to use anything but the console or an ssh session to access this system I might as well strip away all other other stuff out of portage anyway.

Other USE flags I tried that had little or no effect were -xcb -xpm -qt4 -qt5 -dga -xft -kde -motif -qt -gtk -gnome -X -xorg -Xorg -kde. I just went down the USE flag list and started trying each one that appeared X related. After going through the entire list I ran across the instructions for excluding parts of the portage tree which seems a much more efficient way to handle this.
Back to top
View user's profile Send private message
heiwa
n00b
n00b


Joined: 24 Oct 2012
Posts: 70

PostPosted: Sun Aug 16, 2015 9:54 am    Post subject: Reply with quote

I see, USE="-awt -fontconfig" would have had been needed. From the emerge
output you can see that these were the only not disabled use flags.
Both are enabled by default and turn out to pull in xorg dependencies.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum