LinuxQuestions.org
Review your favorite Linux distribution.
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 09-19-2005, 08:44 AM   #1
YBA^[x]
Member
 
Registered: Apr 2004
Location: Denmark
Distribution: Slackware 10.2
Posts: 121

Rep: Reputation: 15
concerning jdk-1_5_0_05


Hey.

Having been away from slackware/linux for a while I got a question concerning jdk-1_5_0_05. For educational reasons I need to use the jdk-1_5_0_05 rather than jdk-1_5_0_04 which is included in 10.2. Preferring installing from packages I wonder how this is possible as i've not been able to find a .tgz with the latest release. Any suggestions on how I get the .bin from sun converted to a .tgz would be greatly appreciated. Thanks in advance.

Regards.
 
Old 09-19-2005, 10:25 AM   #2
Dankles
Member
 
Registered: May 2004
Location: /dev/null
Distribution: Slackware
Posts: 245

Rep: Reputation: 31
A way to do it would be to download the rpm version and run rpm2tgz
 
Old 09-19-2005, 12:14 PM   #3
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
That's a bad package to convert from RPM. Your environment variables won't be setup that way and it won't work without manual tweaking.
Code:
#!/bin/sh

CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-jdk
VERSION=1_5_0_05
DVER=1.5.0_05
ARCH=i586
BUILD=1

if [ -r $CWD/jdk-${VERSION}-linux-${ARCH}.bin ]; then
   true
else
   echo
   echo "I can't locate the Java .bin file... Make sure it resides"
   echo "in the same directory as this script and try again."
   echo
   exit
fi

if [ -s /var/log/packages/jre-1* ]; then
   echo
   echo "It seems that you have the Java Runtime Environment installed already."
   echo "Make sure you un-install it before installing this package..."
   echo
   sleep 7
fi

rm -rf $PKG
mkdir -p $PKG/usr/lib
mkdir -p $PKG/etc/profile.d
mkdir -p $PKG/install

cd $PKG/usr/lib
sh $CWD/jdk-${VERSION}-linux-${ARCH}.bin

chown -R root.root $PKG
( cd $PKG
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 400 -exec chmod 644 {} \;
find . -perm 440 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \; )

( cd $PKG/usr/lib
  mv jdk${DVER} jdk-${DVER}
  ln -sf jdk-${DVER} java )

cat << EOF > $PKG/install/doinst.sh
#!/bin/sh
#
# Browser Check:
if [ -d /usr/lib/mozilla/plugins ]; then
   ( cd /usr/lib/mozilla/plugins
     ln -sf ../../jdk-${DVER}/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so )
fi
if [ -d /usr/lib/firefox/plugins ]; then
   ( cd /usr/lib/firefox/plugins
     ln -sf ../../jdk-${DVER}/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so )
fi
# Begin Symlinks:
EOF

cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in.  You must make
# exactly 11 lines for the formatting to be correct.  It's also customary to
# leave one space after the ':'.

   |-----handy-ruler------------------------------------------------------|
jdk: jdk (Java Development Kit)
jdk:
jdk: The Java 2 SDK software includes tools for developing, testing, and
jdk: running programs written in the Java programming language.  This
jdk: package contains everything you need to run Java(TM).
jdk:
jdk: For additional information, refer to this Sun Microsystems web page:
jdk:   http://java.sun.com/
jdk:
jdk:
jdk:
EOF

cat << EOF > $PKG/etc/profile.d/jdk.sh
#!/bin/sh
export JAVA_HOME=/usr/lib/java
export MANPATH="*MANPATH:/usr/lib/java/man"
export PATH="*PATH:/usr/lib/java/jre/bin"
EOF
sed -i 's@*@$@g' $PKG/etc/profile.d/jdk.sh
chmod 755 $PKG/etc/profile.d/jdk.sh

cd $PKG
makepkg -l y -c n $TMP/jdk-$DVER-$ARCH-$BUILD.tgz

Last edited by jong357; 10-09-2005 at 12:12 AM.
 
Old 09-19-2005, 12:38 PM   #4
Dankles
Member
 
Registered: May 2004
Location: /dev/null
Distribution: Slackware
Posts: 245

Rep: Reputation: 31
thats pretty sweet, I think i will give it a try just for kicks.

EDIT----------------------------

It works great i hope this helps you YBA

Last edited by Dankles; 09-19-2005 at 12:48 PM.
 
Old 09-19-2005, 02:42 PM   #5
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Yea, it's just a modified .SlackBuild script. It does some hand-holding at the very top, creates the misc files for you (slack-desc, doinst.sh and jdk.sh) and sets up your browser java plugin instead of having that as a seperate package like Pat does (the plugin won't be indexed by pkgtool, tho it would be easy to do from a doinst.sh). It also doesn't make a .csh file in profile.d but who uses tcsh/csh anyway?

If you have problems, do it yourself....

I don't like the whole license argement thing interupting the build process but I don't think there is a way around that...

Last edited by jong357; 09-19-2005 at 03:11 PM.
 
Old 09-21-2005, 12:21 PM   #6
YBA^[x]
Member
 
Registered: Apr 2004
Location: Denmark
Distribution: Slackware 10.2
Posts: 121

Original Poster
Rep: Reputation: 15
Very nice. I appreciate it a lot, I'll give it a go as soon as I get 2.6.13.2 working properly. Will post here asap.

Regards
 
Old 09-21-2005, 01:06 PM   #7
objorkum
Member
 
Registered: Aug 2003
Location: Norway
Distribution: Slackware 10.0
Posts: 231

Rep: Reputation: 30
Well, you just have to download the self-extracting package from sun.java.com, extract it, put the extraced folder in /usr/lib, and then change /usr/lib/java to point to the new folder. That's all.
 
Old 09-21-2005, 02:55 PM   #8
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Well, I think the whole idea was for it to be cataloged by pkgtool. But yea, you could do that and then add the jdk.sh environment variables by hand to your /etc/profile or /etc/profile.d/.

Without $JAVA_HOME $MANPATH and $PATH appended to, programs that rely on Java aren't going to work. The .bin doesn't do that for you.
 
Old 09-21-2005, 03:06 PM   #9
objorkum
Member
 
Registered: Aug 2003
Location: Norway
Distribution: Slackware 10.0
Posts: 231

Rep: Reputation: 30
Quote:
Originally posted by jong357
Well, I think the whole idea was for it to be cataloged by pkgtool. But yea, you could do that and then add the jdk.sh environment variables by hand to your /etc/profile or /etc/profile.d/.

Without $JAVA_HOME $MANPATH and $PATH appended to, programs that rely on Java aren't going to work. The .bin doesn't do that for you.
You don't remove the old Java package, and therefore /etc/profile.d/jre.sh still fixes all your variables! They all point to /usr/lib/java
 
Old 10-03-2005, 02:31 PM   #10
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
You leave 2 Java's on your system huh? I suppose that works... I like to keep things tidy and slim tho.
 
Old 10-08-2005, 10:04 AM   #11
ivoencarnacao
LQ Newbie
 
Registered: Feb 2005
Distribution: Ubuntu Linux
Posts: 15

Rep: Reputation: 0
This looks interresting but how would i use this slackbuild script to install java on my slack?
Kinda lame here, pretty new to slack...


Thanks in advance,
Ivo Encarnacao.







Quote:
Originally posted by jong357
That's a bad package to convert from RPM. Your environment variables won't be setup that way and it won't work without manual tweaking.
Code:
#!/bin/sh

CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-jdk
VERSION=1_5_0_05
DVER=1.5.0_05
ARCH=i586
BUILD=1

if [ -r $CWD/jdk-${VERSION}-linux-${ARCH}.bin ]; then
   true
else
   echo
   echo "I can't locate the Java .bin file... Make sure it resides"
   echo "in the same directory as this script and try again."
   echo
   exit
fi

if [ -s /var/log/packages/jre-1* ]; then
   echo
   echo "It seems that you have the Java Runtime Environment installed already."
   echo "Make sure you un-install it before installing this package..."
   echo
   sleep 7
fi

rm -rf $PKG
mkdir -p $PKG/usr/lib
mkdir -p $PKG/etc/profile.d
mkdir -p $PKG/install

cd $PKG/usr/lib
sh $CWD/jdk-${VERSION}-linux-${ARCH}.bin

chown -R root.root $PKG
( cd $PKG
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 400 -exec chmod 644 {} \;
find . -perm 440 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \; )

( cd $PKG/usr/lib
  mv jdk${DVER} jdk-${DVER}
  ln -sf jdk-${DVER} java )

cat << EOF > $PKG/install/doinst.sh
#!/bin/sh
#
# Browser Check:
if [ -d /usr/lib/mozilla/plugins ]; then
   ( cd /usr/lib/mozilla/plugins
     ln -sf ../../jdk-${DVER}/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so )
fi
if [ -d /usr/lib/firefox/plugins ]; then
   ( cd /usr/lib/firefox/plugins
     ln -sf ../../jdk-${DVER}/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so )
fi
# Begin Symlinks:
EOF

cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in.  You must make
# exactly 11 lines for the formatting to be correct.  It's also customary to
# leave one space after the ':'.

   |-----handy-ruler------------------------------------------------------|
jdk: jdk (Java Development Kit)
jdk:
jdk: The Java 2 SDK software includes tools for developing, testing, and
jdk: running programs written in the Java programming language.  This
jdk: package contains everything you need to run Java(TM).
jdk:
jdk: For additional information, refer to this Sun Microsystems web page:
jdk:   http://java.sun.com/
jdk:
jdk:
jdk:
EOF

cat << EOF > $PKG/etc/profile.d/jdk.sh
#!/bin/sh
export JAVA_HOME=/usr/lib/java
export MANPATH="$MANPATH:/usr/lib/java/man"
export PATH="$PATH:/usr/lib/java/jre/bin"
EOF
chmod 755 $PKG/etc/profile.d/jdk.sh

cd $PKG
makepkg -l y -c n $TMP/jdk-$DVER-$ARCH-$BUILD.tgz
 
Old 10-08-2005, 11:54 AM   #12
simcox1
Member
 
Registered: Mar 2005
Location: UK
Distribution: Slackware
Posts: 794
Blog Entries: 2

Rep: Reputation: 30
Where's jre 1.5.0.05? The latest one on sun java site is 1.5.0.04.

Edit: I see. It's the jdk.

Last edited by simcox1; 10-08-2005 at 11:59 AM.
 
Old 10-08-2005, 12:32 PM   #13
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
I just noticed something with that script. I don't ussually make all the extra files from within the build script. I thought it would be nice to do it here on LQ, just because it cuts down on the steps needed. The problem is with jdk.sh. If you use the script, it turns out like this:
Code:
#!/bin/sh
export JAVA_HOME=/usr/lib/java
export MANPATH="/usr/local/man:/usr/man:/usr/X11R6/man:/usr/lib/java/man:/opt/kde/man:/usr/lib/qt/doc/man:/usr/lib/java/man"
export PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/lib/java/jre/bin"
When it should look like this:
Code:
#!/bin/sh
export JAVA_HOME=/usr/lib/java
export MANPATH="$MANPATH:/usr/lib/java/man"
export PATH="$PATH:/usr/lib/java/jre/bin"
They both do the same thing so it will still work, but man that looks like hell. Maybe I'll fix it, maybe I won't. Atleast it has been mentioned...

To use that script ivoencarnacao, copy/paste all of it into a text editor and save it as "jdk.SlackBuild". Then throw the JDK .bin file in the same directory as the script. The .bin file should be called "jdk-1_5_0_05-linux-i586.bin". Then open up a terminal and:

Code:
cd /path/to/jdk.SlackBuild
sh jdk.SlackBuild
When it's done, you'll have a Slackware package sitting it /tmp that you can install by:
Code:
installpkg /tmp/name-of-slackware-package.tgz
Thats it. You can 'removepkg' and 'upgradepkg' as well after you install it.

Code:
man installpkg
Code:
man removepkg
Code:
man upgradepkg
for more info
 
Old 10-08-2005, 03:23 PM   #14
ivoencarnacao
LQ Newbie
 
Registered: Feb 2005
Distribution: Ubuntu Linux
Posts: 15

Rep: Reputation: 0
I really have to learn how to do those scripts...


Thanks for the help,
Ivo Encarnacao.
 
Old 10-09-2005, 12:15 AM   #15
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
fixed the variable problem with jdk.sh.....
 
  


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
jdk not working crash_override_me Ubuntu 3 10-18-2005 12:35 PM
JDK installation pogopogo Linux - Software 2 10-19-2004 12:39 AM
getting jdk for linux. tiredoflogins Linux - Newbie 5 10-05-2004 01:23 PM
Slackware 10 + jdk 1.5 jorge.vargas Slackware 3 07-16-2004 01:42 PM
how to use Jdk 1.3.1 in RH 9 Egyptian_Isis Linux - Newbie 1 11-06-2003 04:15 AM

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

All times are GMT -5. The time now is 11:48 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