OpenJDK 7 update 3 available for Slackware 13.37

 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):

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

 

29 thoughts on “OpenJDK 7 update 3 available for Slackware 13.37


  1. 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


  2. 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


  3. 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



  4. 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.


  5. 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



  6. 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!



  7. 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



  8. 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.


  9. 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


  10. 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?


  11. Pingback: Alien Pastures » OpenJDK 7 update 3 available for Slackware 13.37 | Linux Blog

  12. 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.


  13. 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


  14. Pingback: Problem with openJDK7

  15. Pingback: jre update?

  16. 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. 🙂


  17. 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


  18. 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!


  19. Pingback: Was the status of the continued usage of Java on Slackware ever decided?


  20. 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


  21. 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.


  22. 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



Leave a Reply to warhawk Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.