LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-22-2012, 03:28 PM   #1
Dornith
Member
 
Registered: Jul 2012
Location: U.S.A
Distribution: Archlinux Multilib, Debian 7.0.0 32b
Posts: 153

Rep: Reputation: Disabled
Installing Java 7


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?
 
Old 07-22-2012, 04:47 PM   #2
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-15.0
Posts: 783

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
If this will meet your needs

AlienBobs slackbuilds has a build for openjdk

http://taper.alienbase.nl/mirrors/pe...builds/openjdk

which will build and install

java version "1.7.0_05-icedtea"
OpenJDK Runtime Environment (IcedTea7 2.2.1) (Slackware)
OpenJDK 64-Bit Server VM (build 23.0-b21, mixed mode)

not sure if this will meet your needs but it is worth a look

john

worked first time for me.
no links pointers etc.
it just worked

Last edited by AlleyTrotter; 07-23-2012 at 09:15 AM. Reason: finish post
 
Old 07-22-2012, 04:57 PM   #3
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
You might also want to read the blog post that went with the stuff Mr Trotter linked to: http://alien.slackbook.org/blog/upda...k-7-available/
 
Old 07-22-2012, 05:17 PM   #4
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 530

Rep: Reputation: Disabled
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.

Last edited by TommyC7; 07-22-2012 at 05:22 PM.
 
Old 07-22-2012, 05:26 PM   #5
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 946

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
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.
 
1 members found this post helpful.
Old 07-22-2012, 06:33 PM   #6
Dornith
Member
 
Registered: Jul 2012
Location: U.S.A
Distribution: Archlinux Multilib, Debian 7.0.0 32b
Posts: 153

Original Poster
Rep: Reputation: Disabled
I did what Mat said, and it worked up to the symbolic link. After that it just gives em the error "File exists".
 
Old 07-22-2012, 07:12 PM   #7
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Dornith View Post
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.

Last edited by astrogeek; 07-22-2012 at 07:24 PM.
 
Old 07-22-2012, 09:28 PM   #8
Dornith
Member
 
Registered: Jul 2012
Location: U.S.A
Distribution: Archlinux Multilib, Debian 7.0.0 32b
Posts: 153

Original Poster
Rep: Reputation: Disabled
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".
 
Old 07-23-2012, 01:18 AM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Dornith View Post
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.

Slackware 13.37 jre.Slackbuild here ftp://ftp.slackware.com/pub/slackwar...jre.SlackBuild

Slackware 13.37 jdk.Slackbuild here ftp://ftp.slackware.com/pub/slackwar...jdk.SlackBuild

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]

Last edited by astrogeek; 07-23-2012 at 01:56 AM.
 
2 members found this post helpful.
Old 07-23-2012, 04:01 AM   #10
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 946

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
The jdk-6 SlackBuild-script from 13.37 won't work unmodified since it looks for a .bin package and JDK 7 is shipped as tar.gz package.

Update:
You'll need to patch the SlackBuild-script to make it work with JDK7:
https://www.linuxquestions.org/quest...dk-jre-931082/

Last edited by mats_b_tegner; 07-23-2012 at 04:41 AM.
 
2 members found this post helpful.
Old 07-23-2012, 05:07 PM   #11
Dornith
Member
 
Registered: Jul 2012
Location: U.S.A
Distribution: Archlinux Multilib, Debian 7.0.0 32b
Posts: 153

Original Poster
Rep: Reputation: Disabled
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.

Last edited by Dornith; 07-23-2012 at 05:08 PM.
 
Old 07-23-2012, 06:18 PM   #12
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Glad to hear it is all working!

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

Good luck!

Last edited by astrogeek; 07-23-2012 at 06:19 PM.
 
Old 07-30-2012, 06:57 PM   #13
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 946

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
FYI There is an updated JDK7/JRE7 SlackBuild-script in -current/extra/source according to the latest ChangeLog.

Last edited by mats_b_tegner; 07-30-2012 at 07:02 PM.
 
1 members found this post helpful.
Old 07-31-2012, 05:47 AM   #14
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Quote:
Originally Posted by mats_b_tegner View Post
FYI There is an updated JDK7/JRE7 SlackBuild-script in -current/extra/source according to the latest ChangeLog.
jre and jdk packaged with Pat slackbuilds:
http://www.z01.eu/repo-slack/slackwa...t/development/
 
Old 07-31-2012, 06:02 PM   #15
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Java] Installing Java on Debian Linux lgp171188 Linux - Software 3 06-20-2009 11:40 AM
Installing Java Based Application throws "java.lang.NoClassDefFoundError" ConfigMan_08 Linux - Newbie 10 12-22-2008 04:58 PM
Help installing java Lakota Mandriva 18 12-12-2004 02:02 AM
installing java kshatriyarules Programming 2 12-02-2004 11:04 AM
Installing Java VM? broham Arch 1 11-12-2004 02:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration