Main menu:

Sponsoring

Please consider a small donation:

 

Also appreciated: support me by clicking the ads (costs nothing) :-)

 

Or you can donate bitcoin:

 

Thanks to TekLinks in Birmingham, AL, for providing colocation and bandwidth.

Page Rank

Fame

FOSS Force Best Blog--2013 Award

Recent posts

Recent comments

About this blog

I am Eric Hameleers, and this is where I think out loud.
More about me.

Search

My Favourites

Slackware

Calendar

August 2014
M T W T F S S
« Jul    
 123
45678910
11121314151617
18192021222324
25262728293031

RSS Alien's Slackware packages

RSS Alien's unofficial KDE Slackware packages

RSS Alien's multilib packages

Meta

OpenJDK replacing Oracle’s binaries

I already wrote about it in an earlier post, that I was working on packages for OpenJDK. OpenJDK is an open-source implementation of the Java Platform, Standard Edition. In 2007, Sun delivered to its earlier promise to make Java open source and released the bulk of its code under a GPL license. Since then, high-profile companies like IBM and Apple have done major contributions to the OpenJDK codebase in order to create an industrial-strength alternative to the binary releases of Java SE..

Oracle assimilated Sun in 2010 and obtained the rights to Java SE.

For Linux distros, not much changed because binary releases of the JDK and JRE were still made available for re-distribution. In 2011 however, Oracle decided that new binary releases of its Java SE (the runtime or JRE as well as the SDK) may no longer be included with Linux distros. They retired the “Operating System Distributor License for Java” (DLJ) and decided that distros should compile their own packages using the Open Source codebase of OpenJDK,.which Oracle itself uses as well for their binary builds.

Of course, you as an “individual user of Java SE” still have the legal right to download and use Oracle’s binaries – you’re just not allowed to re-distribute it. Making a Slackware package out of your Oracle-downloaded binaries is simple – use the jdk.SlackBuild or jre.SlackBuild scripts which are part of Slackware and “wrap” those binaries into a convenient package.

While this is a nice solution for the individual, our own Slackware had to stop updating its Java packages. It now has to solve the question of keeping or removing Java from its distribution. Since Oracle’s binaries can no longer be included, Slackware has to follow the advice and build its own Java from source.

This situation now lasts since august 2011 and it is bothering me. So, in November 2011 I made a promise to Pat Volkerding that I would create a set of Slackware packages for the OpenJDK. Unfortunately that took me longer than expected because a lack of time and because (as outlined in my previous post) I wanted to build them in such a way that I could use the SlackBuild scripts on ARMedslack which still lacks a Java package.

I uploaded the results of my efforts last week but Pat has not responded since, so I am making the packages and sources/scriptes available to a wider audience. Please note that I named the resulting packages “openjdk” and “openjre” but the packages that could get included into Slackware eventually may be named differently (like “openjdk-jdk” and “openjdk-jre”). In any case, I invite you to test them and report your findings.

You can get all of it here: http://connie.slackware.com/~alien/openjdk/ with a mirror here: http://alien.slackbook.org/slackware/openjdk/

For ready-made packages (for Slackware-current !) you can check the two directories “pkg64″ (containing 64bit versions) and “pkg” (for the 32bit version of Slackware).  If you want to install my pre-built packages, then all you really need are “rhino” which is the JavaScript engine, “icedtea-web” which is the browser plugin, and one of “openjdk” or “openjre” packages, depending of course on whether you need the full Java compiler suite or only the Java Runtime Environment.

You will also find packages for apache-ant, xalan and xerces.  These are only needed if you want to re-compile OpenJDK yourself. If you want to build your own packages instead of using (or after installing) mine, then follow the instructions in the sources/README.txt file. If you are not running Slackware-current but one of the stable releases, then compiling from source will be your only option.

For you wannabe-compilers, I will repeat part of that README text here. OpenJDK will not compile successfully on Slackware unless you make some modifications to the gcc and seamonkey packages. You can either recompile those using the modified SlackBuild scripts and sources which I also provided in the openjdk sources tree, but you can also choose the less intrusive alternative by running (as root !) two small shell scripts that add the missing functionality to your system: create_gcj_jvm.sh and fix_seamonkey_pkgconfig.sh. These two scripts should work on every Slackware release.

After running the two shell scripts (or after rebuilding gcc and seamonkey) you are ready to (build and) install apache-ant, xalan, xerces and rhino, logout and log back in again to set the ANT_HOME environment variable, and proceed with building OpenJDK and icedtea-web. Good luck!

Any questions or feedback about these scripts and packages? Please post them here and I will follow up.

Cheers, Eric

Comments

Comment from Daniel
Posted: January 7, 2012 at 18:48

probably a stupid question…but, do i need to remove the existing JRE package first?

Comment from alienbob
Posted: January 7, 2012 at 19:42

Slackware’s upgradepkg is able to upgrade to a package with a different name.
For instance, if you are on 32bit Slackware and downloaded the openjre package, you would run:

# upgradepkg jre%openjre-7_b147-i486-1.txz

Eric

Comment from Mikko
Posted: January 7, 2012 at 19:46

Any experience on Android SDK and openjdk?

Officially Android SDK does not support it, as far as I know.

Comment from John
Posted: January 8, 2012 at 00:51

Hey Eric
I have been compiling your LibreOffice packages for some time now. You probably remember some of the humps you helped me over.
Would you suggest to re-compile LibreOffice after compiling the JDK as some of it depends on the JDK?
Special thanks on the section for “For you wannabe-compilers,” as I am sure I will need it.

Thanks
john
AlleyTrotter

Comment from Martinus Ady H
Posted: January 8, 2012 at 10:44

Thx Eric, :) Love this package :D Btw why Slackware not including *update-alternatives* app like ubuntu/debian based ? With this, we can switch easily from jdk to openjdk :)

Comment from alienbob
Posted: January 8, 2012 at 13:36

Hi Martinus

Slackware does not always do things the way other distros do it. Introducing the “alternatives” program would make many SlackBuild scripts a whole lot more complex.

Instead, Slackware’s package manager does not know about dependencies, so “upgradepkg openjre%jre-6u27-x86_64-1.txz” works fast and with the same end result as running the update-alternatives command…

Eric

Comment from manciuleas
Posted: January 9, 2012 at 04:13

Hi Eric,
Thanks for the package. Unfortunately it seems not functional, jvf.cfg and and java.policy are missing from /etc/java and therefore the binary returns an error when I’m trying to run it:
Error: could not open /usr/lib64/java/lib/amd64/jvm.cfg’

Comment from manciuleas
Posted: January 9, 2012 at 04:13

Hi Eric,
Thanks for the package. Unfortunately it seems not functional, jvm.cfg and and java.policy are missing from /etc/java and therefore the binary returns an error when I’m trying to run it:
Error: could not open /usr/lib64/java/lib/amd64/jvm.cfg’

Comment from amigib
Posted: January 9, 2012 at 11:43

@manciuleas

Those missing files are in openjdk package.

Comment from powtrix
Posted: January 9, 2012 at 15:39

Hi Eric.
testing with http://javatester.org/version.html it says in Firefox “Browser has Java disabled” and in Chrome it says that the plugin is missing. Should I link it manually?

Comment from alienbob
Posted: January 9, 2012 at 17:30

amigib, manciuleas -

Amigib is right. I will have to fix up my openjre package and add the missing .cfg files. Hope to find the time somewhere later this week.

In the meantime, install openjdk as a workaround.

Eric

Comment from alienbob
Posted: January 9, 2012 at 17:31

@powtrix -

You did install the icedtea-web package did you? What version/architecture of Slackware are you running?

Eric

Comment from powtrix
Posted: January 9, 2012 at 18:33

oops, icedtea is the needed package, solved.
I’m running slackware64-current.
thanks!

Comment from escaflown
Posted: January 11, 2012 at 01:39

openjre working well here so far. Thanks Eric!

Comment from bratpit
Posted: January 11, 2012 at 17:04

Hi

I have problem with run java jnlp file /link below/ on default 6u24 .
Permission error but run it from root causing the same error permission ??????

Są I install your openjre and……

javaws http://makler.bmbgz.pl/sidoma8inter/sidoma_kl.jnlp

returns error .”could not parse jnlp file”.

It is bad because on Centos on VM it runs like charm. Any ideas?

Best regards

Comment from alienbob
Posted: January 11, 2012 at 20:52

Well, what does your CentOS use? Oracle JRE or OpenJRE? A question like yours can not really be answered since I do not run CentOS anywhere.
Also you should consider that the open source web plugin “icedtea-web” is not based at all on the plugin code from Sun because that was not open-sourced. Instead iceddtea-web is based on an earlier open-source effort, the NetX project: http://jnlp.sourceforge.net/netx/ . Their JNLP parser is not as mature as Sun’s. I found web pages too where the Icedtea-web plugin would throw a parser error.

You may tell me how to fix my SlackBuild so that the resulting package works like CentOS.

Eric

Comment from bratpit
Posted: January 11, 2012 at 22:04

Thank you for response.

I use Slackware 13.27.
And Suns jre from ages :-)
Java instalation works OK in browser plugin but lately my broker give me start aplication over jnlp file, and Slackware instalation failed to run that way.I checked on various sun java 1.5 and 1.6. And on slack based distribution Salix.
Always the same error.”Can not run /usr/lib/java”

And finally broker email me and send picture from Centos.
I instaled it on virtual machine and aplication from the same jnlp runs like hell on the same Sun java.
On Centos Java installs from rpm and simply copy files from rpm to /usr/java/java_ver/ and then symlink java and javaws to /usr/bin and works .

Next I instaled Openjre from your package but it not worked like I wrote before.

Thats all.There is some bug.

I’ll try extract from Sun’s rpm and do package for Slackware by hand like in rpm .May be it will start working.

Thanks again.

Comment from amigib
Posted: January 14, 2012 at 10:35

I discovered another problem. When i tried install/update Minecraft game i get error like:

java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

I found solution here
http://stackoverflow.com/questions/4764611/java-security-invalidalgorithmparameterexception-the-trustanchors-parameter-mus

Just copied ‘cacerts’ file from windows to linux, but i’m wondering why this file on linux is empty.

Comment from alienbob
Posted: January 14, 2012 at 14:27

FYI,

BratPit documented the solution to the problem he described in his above comment, here:

http://www.linuxquestions.org/questions/slackware-14/sun-java-not-run-some-jnlp-file-923587/#post4573790

The JRE package sets a wrong JAVA_HOME environment variable.

Eric

Comment from alienbob
Posted: January 14, 2012 at 14:35

Hi Amigib

You mean, Minecraft works for you now? I will have a look at how to deal with the cacerts file.
Thanks,

Eric

Comment from alienbob
Posted: January 14, 2012 at 14:48

Amigb,

Initially I was unable to run Minecraft because it reported a library issue, but I tried some more and I found that I can successfully run it when I add “LD_LIBRARY_PATH=/usr/lib64/java/jre/lib/amd64″ to the commandline.

I wonder, how do you start?

Eric

Comment from amigib
Posted: January 14, 2012 at 17:27

It was working earlier, problem appear when i tried update game to 1.1 and it was related with cacerts file.

I’m not playing in browser and using standard commands:

java -jar minecraft.jar

Comment from alienbob
Posted: January 14, 2012 at 20:13

I created a wrapper script that I put in /usr/bin/minecraft , this is what it contains – Minecraft runs perfectly:

#!/bin/sh

# A wrapper script to start MineCraft.
# It should work with the Sun JRE/JDK as well as with the OpenJRE/JDK.

# If your computer has less than 2 GB of RAM you may have to set
# a lower value here (value is in MB):
MAXMEM=1024

# Fix for users of special IM modules
unset XMODIFIERS GTK_IM_MODULE QT_IM_MODULE

LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:$JAVA_HOME/lib/amd64/:$JAVA_HOME/lib/i386/:$JAVA_HOME/jre/lib/amd64/:$JAVA_HOME/jre/lib/i386/” exec java -Xmx${MAXMEM}M -Xms$(($MAXMEM/2))M -cp /usr/share/minecraft/minecraft.jar net.minecraft.LauncherFrame “$@”

Comment from moldavia
Posted: January 15, 2012 at 20:59

I’m upgrading to openJDK just because I was getting random lockups trying to run Minecraft on Slack-current. I was happy to find some Minecraft specific info here. I am having a different problem now. It seems to be a path related problem. When trying to run using my script, or the one you posted here, the launcher will show, but when I try to log in, I get a UnsatisifiedLinkError.

Exception in thread “Minecraft main thread” java.lang.UnsatisfiedLinkError: /home/moldavia/.minecraft/bin/natives/liblwjgl.so: libjawt.so: cannot open shared object file: No such file or directory

As far as I can tell, the paths are correct, and libjawt.so is in /usr/lib/java/jre/lib/i386…

Any ideas?

Comment from moldavia
Posted: January 15, 2012 at 21:18

Never mind. I installed the Minecraft package you released, and now it runs without error. Thank you very much.

Comment from alienbob
Posted: January 15, 2012 at 22:12

I will be posting updated openjdk and openjre packages soon, which fix all kinds of issues.
For instance, the java web start (javaws) will not work with just openjre installed; the openjre pakage misses two important configfiles which makes it unusable, and the CA certificates file is empty in both JDK and JRE packages…

Eric

Comment from dolphin77
Posted: January 17, 2012 at 10:56

Hi, Erik.

Thanks for you work on openjre|jdk.

After installing your packages I have double entry to java bin files in $PATH. Is this mistake, or should it be like this?

vladimir@darkstar:~$ cat /etc/profile.d/openjdk.sh
#!/bin/sh
export JAVA_HOME=/usr/lib64/java
export MANPATH=”${MANPATH}:${JAVA_HOME}/man”
export PATH=”${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/bin”

vladimir@darkstar:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/java/bin:/usr/lib64/java/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin:.

Comment from alienbob
Posted: January 17, 2012 at 15:04

Hm, looks like I was a bit sloppy in updating the profile scripts for the JRE package. It should be:

export PATH=”${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin”

for the JDK package, and

export PATH=”${PATH}:${JAVA_HOME}/bin”

for the JRE package. I’ll have to come up with a better sed command.

Eric

Comment from Ivan
Posted: January 30, 2012 at 05:01

Hi Erik! I like your effort to bring OpenJDK framework to Slackware. But, I have some serious problems when running java programs with swing guis, to be precise Jmol and Toxtree, which are standard tools in mine research projects for years, and worked fine on Java VM from /extra. I’m running Slackware64-current, freshly installed maybe two weeks ago.

Ivan

Comment from alienbob
Posted: January 30, 2012 at 19:02

Ivan

Without commenting on the nature of your issues I can not really answer you. I know nothing of Jmol or Toxtree.
Also, you can still use Oracle’s binary distribution of Java if you want. Using the SlackBuild script you can package any new release into a proper package. Distros are no longer allowed to distribute those binaries, but individual users can use it without restriction.

Eric

Comment from Ivan
Posted: January 30, 2012 at 21:12

Sorry, I apologize, because my former post says nothing about real problem. The problems are swing gui elements, everything was disturbed, menu bar gone, and other program couldn’t load any images for tool palette… I’m really confused, because I cannot sense what’s the cause of the swing problems with OpenJDK. Maybe this snapshot of Jmol main window self explains: http://i44.tinypic.com/ib9wrl.jpg.

Ivan

Comment from alienbob
Posted: January 30, 2012 at 23:01

Ivan

I downloaded and ran Jmol on my laptop with OpenJDK installed.
This is a screenshot of what I see: http://alien.slackbook.org/blog/openjdk-replacing-oracles-binaries/jmol_openjdk7/
I do not seem to have issues with it. What version of Slackware are you using? What Window manager?

Eric

Comment from Ivan
Posted: January 30, 2012 at 23:33

Now I’m confused even more… Yes, yours Jmol works perfectly! My installation is Slackware64-current, fresh and (still) clean copy, without multilib, only fewer extra packages, yours LibreOffice, VLC and OpenJDK and some academic packages from SlackBuilds.org, but nothing that can suggest that I messed some system library or have mixed versions. I’m using Xfce, but I tried under KDE a moment ago, and same problem was with gui. I’m not Java developer, but I know the language from my masters bioinformatics course, and I think that Swing classes was designed to be quite independent from OS-specific code, and relies on very basic graphics procedures. From that fact, I can only conclude that my problem is connected with some serious OpenJDK bug, but I have no idea why it manifests only on my system.

Thank you for your time Erik, I really appreciate your work in Slackware community.

Ivan

Comment from alienbob
Posted: January 30, 2012 at 23:44

I am running slackware64-current too, but with some newer packages than are available to the public. However I do not think that that is the reason it works for me.

I changed one thing to the openjdk installation which made some other Java software work; and I intended to add it to my openjdk.SlackBuild

Can you try the following command as root (using the “lib64″ since you say you are running 64-bit Slackware)?

( cd /usr/lib64/java ; mkdir jre ; ln -s ../lib jre/lib ; ln -s ../bin jre/bin )

And then check again if Jmol works for you.

Eric

Comment from Ivan
Posted: January 31, 2012 at 00:06

When change directory to /usr/lib64/java there exists jre with lib and bin branches, so mkdir jre is unnecessary, and returns “mkdir: cannot create directory jre’: File exists”. Still, I have done linking with ln -s as you suggested, but nothing has changed then, Jmol still has stuck gui.

Ivan

Comment from alienbob
Posted: January 31, 2012 at 00:14

OK, so you have installed the openjre package. Can you try installing the openjdk package instead and see if that works better?

Eric

Comment from Ivan
Posted: January 31, 2012 at 00:36

OK, I have removed openjre and, for just in case, reinstalled openjdk, and now Jmol even cannot create main window. When started from terminal, Jmol returned many java exceptions to stderr… It is quite distracting problem, and probably has simple solution, but for now I’m not enough skilled to figure it out, I’ll leave it for tomorrow. :)

Comment from donito
Posted: January 31, 2012 at 19:33

Eric, I apologize for posting something off-topic but wasn’t sure where else to ask. I’ve noticed there haven’t been any updates to either current or stable for two months now, including security updates. Are you aware of any problems that Patrick is having? Maybe health related? It’s just not like him to go this long without any updates. I’m starting to fear the worst that maybe he has decided to move on. Any info would be helpful. And thanks again for all your contributions.

Don

Comment from alienbob
Posted: January 31, 2012 at 21:49

I guess you do not surf the internet too often? I have explained on several occasions, in several forums, and in another blog post on my own site as well, that Pat needs time to tend to his family and other matters. In the meantime, I keep you busy with my KDE, OpenJDK, LibreOffice, VLC and other packages :-)

My most recent comment was http://www.linuxquestions.org/questions/slackware-14/new-distro-time-926188/page4.html#post4588775

Eric

Comment from donito
Posted: February 1, 2012 at 00:29

Apparently we don’t surf the same websites. lol. I certainly don’t blame Patrick for wanting to take care of the important things in life. He definitely deserves a much needed break. Perhaps a small note in the changelog would have made it less confusing for a lot of us wondering what was going on. Thank you for clearing this up.

Pingback from OpenJDK 7 problem with Swing GUI apps on Slackware64 13.37-current
Posted: February 2, 2012 at 21:33

[...] here http://i44.tinypic.com/ib9wrl.jpg And I asked Erik about the problem on his slackware blog: http://alien.slackbook.org/blog/open…cles-binaries/ [...]

Comment from Mário Antunes
Posted: February 24, 2012 at 14:05

Hi I found out that the version of openJDK was a know bug (https://netbeans.org/bugzilla/show_bug.cgi?id=205348) that is resolved in newer version of openJDK.

Is it possible to build new packages with the new version?

Comment from alienbob
Posted: February 24, 2012 at 16:08

Hi Mário

I am already looking at a new package build, using icedtea 2.1 (my current openjdk package is based on icedtea 2.0).
Who knows, I will have new packages soon, it depends on my family’s health (the rest of the family is ill and I hope I do not catvh whatever they have).

Eric

Pingback from Faça um teste no Slackware currentlinuxandlifestyle
Posted: March 16, 2012 at 22:12

[...] das novidades será o OpenJDK que substituíra o os binários da Oracle. O que me empolgou bastante é perceber que o Slackware vai lançar sua primeira versão com o [...]

Pingback from Does anybody have a SlackBuild for Libre Office (ARM).
Posted: March 23, 2012 at 11:56

[...] Bob also has a blog post on using OpenJDK on Slackware, where he mentions, [...]

Pingback from Alien Pastures » OpenJDK 7 update 3 available for Slackware 13.37
Posted: June 16, 2012 at 14:27

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

Pingback from How to install the latest Java in Slackware | It's like my RATTATA is in the top percentage
Posted: July 17, 2012 at 18:59

[...] obsolete now that Java has gone away from Slackware due to licensing restrictions. Consider using OpenJDK or the SlackBuild scripts from [...]

Write a comment