The JDK and JRE packages in Slackware are severely outdated. In case you are not familiar with them, “JDK” is the Java Development Kit and “JRE” is the Java Runtime Engine. As stated in a previous post on this blog, Slackware (and with it all the other distros) is no longer allowed to distribute Java packages based on the official binaries released by Oracle. You as an end-user are still allowed to download and use those binaries; you are just not allowed to re-distribute them.
You can do two things: grab Oracle’s binary tarballs, and use the jdk.SlackBuild and jre.SlackBuild scripts of Slackware to create updated packages with which you can upgrade an existing Java on your computers. Or you grab the source code of OpenJDK and build your own re-distributable packages. This second option is hopefully what Slackware will pick for its future releases.
In the meantime, I produced packages for slackware-current back in January 2012, compiled from these OpenJDK sources with the use of the icedtea build harness. That was a first, and successful, attempt at creating new JDK and JRE that could be used in Slackware. I was targeting slackware-current in the hope that Pat Volkerding would use the SlackBuild scripts as-is. Unfortunately, Slackware’s development has stalled a bit, and the ChangeLog.txt has not seen Java updates yet.
So, when I noticed that there was a new release of IcedTea which would produce very up-to-date OpenJDK binaries, I decided to build this on Slackware 13.37 instead of slackware-current and add the resulting packages to my regular repository. This allows everyone who is running Slackware version 13.37 or -current to enjoy the new JDK and web plugin.
Pre-built packages:
Packages and sources can be found in the usual locations. There are more mirrors than I mention here of course. Note that you need a JDK or JRE package (based on your needs), the rhino package (which is the JavaScript engine) and optionally icedtea-web (the Java browser plugin):
- http://slackware.com/~alien/slackbuilds/openjdk/ and http://slackware.com/~alien/slackbuilds/icedtea-web/ and http://slackware.com/~alien/slackbuilds/rhino/ (master site)
- http://taper.alienbase.nl/mirrors/people/alien/slackbuilds/openjdk/ and http://taper.alienbase.nl/mirrors/peop/alien/slackbuilds/icedtea-web/ and http://taper.alienbase.nl/mirrors/peop/alien/slackbuilds/rhino/ (my own mirror)
Compiling:
I built these packages twice: the first time I “bootstrapped” using the gcc-java compiler. The second time, I had installed my fresh openjdk package and built a new copy against itself. The value of the “BOOTSTRAP” variable in the script determines the type of build. You can not build OpenJDK with the Oracle JDK.
If you want to do this compilation yourself, then follow the README.txt carefully! You will additionally need to install apache-ant, xalan and xerces packages, all of which you will find in my package repository. If you are not on slackware-current then you will have to make some small modifications to the installed gcc and seamonkey packages. When following directions in the README.txt this is a trivial task.
Web plugin:
You can check if your web plugin has been installed and is working correctly, by visiting this URL: http://java.com/en/download/installed.jsp?detect=jre&try=1 .
After I finished building my packages I visited the above URL and it looked OK. Then I loaded a java applet on another page (http://chemagic.com/web_molecules/) and it crashed so hard that it took the browser down along with it. Wtf???
I had originally used version 1.1.4 of the icedtea-web sources (since that used to work before) but it turns out that there was a change in Mozilla Firefox since version 10.0. The change uncovers a bug which makes the plugin crash with the error message “Assertion failure: rt->onOwnerThread(), at /tmp/mozilla-release/js/src/jsapi.cpp“. I tracked down the bug reports, https://bugzilla.mozilla.org/show_bug.cgi?id=704249 and http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=820, and eventually found a working patch on the mailing list. This patch could only be applied against the latest source code for icedtea-web, which is why you will find an icedtea-web package with version “20120225” in my repository.
Good luck! Eric
Hi Eric. Trying to download rhino gives me a 404. Searching the repository myself and rhino is not there.
Hey Eric!
I will definitely be jumping on this right after church today. Big day also plan to watch Danica Patrick in the Daytona 500.
Thanks for all your great work
Wanna-be-compiler
john
Hi Mike
I forgot to upload the rhino package and sources… I fixed that now, thanks for the feedback.
I also took the opportunity to rename the packages for openjdk and icedtea-web, they were missing the “alien” tag.
Eric
Thanks Eric. This will be very useful.
Am I right in thinking that it’s best to remove slackware’s jre and jdk packages before installing these ones?
Andrew
Of course you need to first “removepkg” any Oracle JRE or JDK you have installed! The two will not work at the same time.
Eric
Eric just got around to testing this out.
Playstation Media Player (PMS) fails with :-
./PMS.sh: line 52: /usr/lib64/java/bin/java: No such file or directory
./PMS.sh: line 52: exec: /usr/lib64/java/bin/java: cannot execute: No such file
I traced this back to a difference between your open package the the Sun package.
Sun package has all subdirs under /usr/lib64/java
Open package has all subdirs under /usr/lib64/java/jre
You can fix it either by change the dir layout to the same as the sun package or by changing the JAVA env variable to include the /jre on the end and adjusting the others to suit.
Hi Wild Wizard
Did you try this _after_ logging out and logging in again?
Yes, the java binary is in a different directory but after logging out and back in your profile should have been updated with a different $PATH entry.
Eric
Thanks Eric! Working fine here. I hope this will soon make ti to -current.
Hi Eric,
I have a little question about multilib in Slackware 13.37: the 8 February Slackware 13.37 update include a glibc changes, is not necessary wait for new glibc for multilib 13.37 with this changes? the last multilib glibc include “11-11-11” update from November 2011.
Thanks a lot and sorry for off-topic, greetings!
Yes Eric, the problem is not the path but the JAVA_HOME env variable which is used as the path to the java run-time, the PATH env variable is not used to find the java run-time at all.
See :-
http://tldp.org/HOWTO/Enterprise-Java-for-Linux-HOWTO-2.html
Note that the java binary is located at $JAVA_HOME/bin/java
Your package currently has it at $JAVA_HOME/jre/bin/java
Hi Wild Wizard
Yes, I think you are (partly) right and I have to change the PATH value in the /etc/profile.d/openjre.* scripts.
As far as I understand it, the JAVA_HOME environment variable points to the location where a Java Development kit is installed. The JRE can be (but not necessarily so) in a subdirectory below ${JAVA_HOME}.
Using the JRE is done by calling the “java” or any of the other available binaries – as long as they are found in the $PATH, they will start, and will find their installed directory.
Correct me if this is wrong.
Eric
I see that you update today multilib glibc for Slackware 13.37, thanks a lot Eric.
Back to OpenJDK 7, In my case i make (as root):
ln -sf /usr/lib64/java/bin/jconsole /usr/bin/jconsole
ln -sf /usr/lib64/java/bin/policytool /usr/bin/policytool
to use jconsole and policytool on xfce 4.8 “development” menu that appears broken link to this binaries.
regards.
Warhawk,
If you install the openjdk package you have to logout and login again before you can use it. The package installs a profile script which adds “/usr/lib64/java/bin” to your $PATH so that the symlinks you created are not necessary.
Eric
Eric,
I like letting java have access to the system clipboard. In the past I’ve just added this into /etc/java/java.policy
permission java.awt.AWTPermission “accessClipboard”;
Do you know if this is the best way to do this? Is there another way to allow java access to the system clipboard?
Hi, Eric.
Looking into changelog makes me think of you already received (or expecting to receive) Raspberry PI :))).
Something tasty is being cooked in your kitchen. Mmmm. I already smell taste of small piece of hardware running Slackware with all the benefits of open source. Good luck, Eric. And thank you for the very interesting projects you are working on.
Well I am expecting to receive a Raspberry Pi, but looking at the distribution issues these guys are experiencing (due to the massive demand – I mean, they built 10,000 devices and got 3,000,000 orders) it may take a while before I actually see it arriving on my doorstep.
Eric
This is really nice. I would appreciate it if you could post some instructions on how to use your build to track the latest OpenJDK updates. A recent 7u4 was released, and I would like to upgrade, but your source directory in the build differs from the .zip distribution that is released in the notices. It would be nice to have a simple checklist for building newer versions. Or you could just build them for us, but that’s less fun. 🙂
Hi Aaron
The way OpenJDK is commonly built these days, using the IcedTea build harness, does not allow for a compilation of a OpenJDK version of your choice. Every IcedTea release builds exactly one OpenJDK version.
If you read http://blog.fuseyism.com/index.php/2012/02/15/icedtea-2-1-released-openjdk7-u3-release/ then you’ll see that my openjdk package “7u3” already contains several fixes which were scheduled for “7u4”. Also, a more recent article on that blog gives a hint that IcedTea 2.2 is around the corner – that will be the release which builds openjdk 7u4.
You can of course compile openjdk without using icedtea at all (in fact my first non-public builds were done that way) but then you lose the ability to add the Java browser plugin (icedtea-web) which requires that openjdk was built with icedtea.
That is why I decided to do what every other distro does too, and that is to use icedtea and the plethora of patches that it applies to openjdk when compiling.
Eric
Thank you for clarifying the situation with OpenJDK and how it relates to IcedTea. I find this to be a really complicated way of doing things! I am considering using the JVM as a base for a language that I am writing, but the complexity keeps getting me every time!
Hello Eric
JRE is working fine at my Slackware64-current now !!
Thanks for your effort.
Franco
Eric, the chrome binary stopped working after I installed the openjre, rhino, and icedtea packages. I’m getting an error message to the effect that an open session of chrome exists, and that I risk corruption of my user profile. No chrome process is active though. Chrome worked again after I removed the three new packages. Slack 14, Chrome Version 21.0.1180.90 (156592)
Thank you
Hi, Here’s the precise error message.
chrome
[2269:2269:155845386:ERROR:process_singleton_linux.cc(907)] Failed to create socket directory.
[2269:2269:155845656:ERROR:chrome_browser_main.cc(1552)] Failed to create a ProcessSingleton for your profile directory. This means that running multiple instances would start multiple browser processes rather than opening a new window in the existing process. Aborting now to avoid profile corruption.
Hi, it really would have been better if you posted this in the most recent openjdk thread on my blog.
We are at Update 9 now, and your posting in a eight-month old thread does make me wonder if you are trying the old Update 3 package instead of my latest openjdk-7u9_b30-x86_64-1alien package.
I have that openjdk installed on this multilib Slackware 14 desktop, along with rhino and icedtea-web. I also have google-chrome-21.0.1180.89-x86_64-1 as packaged from Slackware’s /extra directory and it has never given me a problem.
Further discussions I would like to see in the most recent post about openjdk please.
Eric
Hi Eric,
Sorry about that! I posted to the wrong forum thread. I’ll try the newer packages this weekend.