SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am a Java developer who just recently switched to Slackware. One of the first things I noticed is that it's sill on Java 6. I went to the website to download the Java 7 development and run-time environment, but neither present any obvious way to install it, and I can't find anything online. How do I install Java 7?
It is also possible to use Pat's own .SlackBuild for the newer licensed proprietary Java. Just gotta download and move it to the same directory as the .SlackBuild (and other files, e.g. slack-desc), and the .SlackBuild by itself should be enough to create a package.
If you want to use the Oracle binaries, download the tarball and move it to the desired location, (i.e /usr), unpack it and add the JAVA_HOME environment variable to your PATH: (i.e add the following lines to your .bash_profile)
export JAVA_HOME=/usr/jdk1.7.0_05
export PATH=$JAVA_HOME/bin:$PATH
Make a symbolic link to the JRE: (The JRE is included in the JDK)
cd /usr/lib(64)/mozilla/plugins
For a 32-bit system:
ln -s /usr/jdk1-7-0_05/jre/lib/i386/libnpjp2.so .
For a 64-bit system:
ln -s /usr/jdk1-7-0_05/jre/lib/amd64/libnpjp2.so .
Update: If you install JDK7 to your $HOME directory you can have both JDK6 and JDK7 installed on the same system.
Last edited by mats_b_tegner; 07-23-2012 at 02:35 AM.
I did what Mat said, and it worked up to the symbolic link. After that it just gives em the error "File exists".
That is probably because the file
Code:
/usr/lib(64)/mozilla/plugins/libnpjp2.so
...(or another symbolic link of that name) already exists, being leftover from the original jre/jdk package.
You should be able to simply remove it and create the new one in its place. (In fact, it may already point to the right place!)
If you instead use the original slackbuild script to build a new package using java 7 then it will take care of the symlinks, and other housekeeping chores, for you.
Okay, I got everything set up, but now when I do a plug-in test with firefox, it still says my Java is out of date. Also, when I try to run the Java program from the menu, it never opens up (at least the GUI doesn't) so I can't check to see if it's updated there. And when I try to check from console, I get this: "java: relocation error: java: symbol JLI_Launch, version SUNWprivate_1.1 not defined in file libjli.so with link time reference".
Okay, I got everything set up, but now when I do a plug-in test with firefox, it still says my Java is out of date. Also, when I try to run the Java program from the menu, it never opens up (at least the GUI doesn't) so I can't check to see if it's updated there. And when I try to check from console, I get this: "java: relocation error: java: symbol JLI_Launch, version SUNWprivate_1.1 not defined in file libjli.so with link time reference".
I do not have a 64 bit system here, so I was waiting for someone better to reply, but if not, here are my thoughts:
First, following Mat's instructions is maybe OK on a system that does not already have java installed, but unpacking the archive directly into the /usr directory is not really something that you should normally do anyway.
Because the symlink or file already existed you probably did not first remove the existing java package. So you probably now have a mixed bag of java on your system.
At the very least I would tell you to remove and reinstall the original java package (java 6). I always use removepkg and installpkg, but you could the same with pkgtool (or sbopkg?). But the idea is, restore your system to a known good state with java 6.
Then as TommyC7 and I indicated earlier, try to use Pat's original Slackbuild to build the java 7 package from the tarball. These should require only a version edit in the Slackbuild script. Place the slackbuild script (plus slack-desc, profile.d, other files from source tree) and java 7 tarball in the same directory and build.
If it builds OK, simply removepkg jre (or jdk), then installpkg path-to-new-package.tgz.
The package will then take care of basic environment variables and symlinks, and keep your system clean (and your package DB in sync).
If you hit any snags, perhaps someone with a 64 bit box can chime in here - but it should be pretty simple.
[EDIT]
On reviewing the posts here it is not clear at all that this is for a 64 bit machine, sorry.
But in either case the advice to clean up by removing/reinstalling java 6, then building java 7 package using the same slackbuild script should work fine. Be sure to read the pages linked on Eric's blog above as well.
[/EDIT]
Firstly, I would like to thank you all so much. I've spent days working on this and now it's all working perfectly.
I uninstalled Java completely as Astrogeek suggested and downloaded the SlackBuild too. (Although you gave me the 32bit links, which took me a while to figure out) I manually applied the patches that Mat linked to and now it's all working. The Java GUI runs and shows Java7 installed, and Firefox says I'm up-to-date. Thank all so much for helping me.
Also, I did create most of my problems myself by working with packages when I didn't really understand them at all.
Sorry I was not more clear about the 32/64 Slackbuld, I wrote that all on the fly.
Working with Slackbuilds to create your own packages is really easy and well worth the trouble to understand fully - it is how Slackware is put together!
The power of the package is of course, you can easily update to a new version without breakage and you can distribute and archive your own pacakges across your own systems.
When updating an official Slackware package you can almost always adapt the Slackbuild from the distribution source directories. For apps that are not natively part of Slackware you can usually find build script at Slackbuilds.org, or create one from a similar script.
FWIW - If you have disk space it is always a good idea to keep an archive of the build scripts and sources that you have updated. When java 7_06 is released simply edit the version in the script and build the new package. Then removepkg jre/jdk, installpkg path_to_new... makes updating trivial (usually).
You really should take those packages down...the reason they are not being shipped with Slackware is because Oracle has removed binary redistribution rights so by hosting binary packages you are likely violating the law (or at least inviting a cease and desist from Oracle). Since the SlackBuilds just repackage the official binaries it should be easy for anyone to run it and thus hosting packages is not overly necessary anyway.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.