LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Any location of SlackBuild for jdk6? (https://www.linuxquestions.org/questions/slackware-14/any-location-of-slackbuild-for-jdk6-4175518503/)

FeyFre 09-13-2014 05:55 PM

Any location of SlackBuild for jdk6?
 
Hello

Does anyone has/knows where from I can fetch a SlackBuild for installing JDK6? slackbuilds.org and official tree contains slackbuild for JDK7, and as far as I know it cannot be converted into SlackBuild by manually specifying VERSION variable during slackbuild run(different original packages formats, etc). I am new in my current Java project and would not risk using newer versions in order to not break anything.

Thanks.

moisespedro 09-13-2014 06:09 PM

I thought the Slackbuild was version-agnostic so to say. It doesn't mention any version on it.
http://slackware.mirrors.tds.net/pub....1/extra/java/

astrogeek 09-13-2014 06:17 PM

Use the one from an older Slackware such as Slackware 12.1 which was at JDK 6u6. It appears that Slackware 13.37 was the last versioned JDK included with Slackware at 6u25.

I too thought it was version agnostic, but not really sure if the Oracle acquisition changed anything.

irgunII 09-14-2014 10:40 AM

I've been using every latest JDK update that comes out using the regular slackbuild for it and substituting in the JDK build number. Right now I have JDK 8u5 (correction, I got sloppy and missed something maybe, but I *now* have the latest, which is 8u20). You have to pay attention to the version *AND* the DVER of the tarball you downloaded.

Here's the jdk.Slackbuild I have for it:

Code:

#!/bin/sh

# Modified for SlackBuilds.org by David Somero

# Based off of java.Slackbuild
# Copyright 2008, 2009, 2010, 2011, 2012  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=jdk
VERSION=${VERSION:-8u5}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

DVER=1.8.0_05

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm echo "Unsupported arch" exit 1;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-jdk
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "x86_64" ]; then
  LIB_ARCH=amd64
  LIBDIRSUFFIX="64"
  SRC_ARCH="x64"
else
  LIB_ARCH=i386
  LIBDIRSUFFIX=""
  SRC_ARCH="i586"
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $PKG
mkdir -p usr/lib${LIBDIRSUFFIX}
cd usr/lib${LIBDIRSUFFIX}
tar xvf $CWD/$PRGNAM-$VERSION-linux-$SRC_ARCH.tar.gz
chown -R root.root $PKG
find $PKG \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \; -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \;

mkdir -p $PKG/etc/profile.d
for file in $(ls $CWD/profile.d/${PRGNAM}*) ; do
  cat $file | sed -e "s#lib/java#lib${LIBDIRSUFFIX}/java#" \
    > $PKG/etc/profile.d/$(basename $file)
done
chmod 755 $PKG/etc/profile.d/*

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

if [ ${EXPLOIT_ME:-"no"} = "YES" ] ;then
  mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins
  cd $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins
  ln -sf /usr/lib${LIBDIRSUFFIX}/java/jre/lib/${LIB_ARCH}/libnpjp2.so libnpjp2.so
else
  echo "
        The February 2013 Critical Patch Update for Java SE addressed 50
        security vulnerabilities, 44 of which affected the use of Java
        as a plug-in for Web browers.

            !! THE MOZILLA PLUGIN IS NO LONGER ACTIVATED BY DEFAULT !!
      "
  sleep 5
fi

cd $PKG/usr/lib${LIBDIRSUFFIX}
    ln -sf ./java/jre/lib/${LIB_ARCH}/server/libjvm.so .

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat << EOF > $PKG/install/doinst.sh
# Clean up a potential upgrade mess caused by changing the
# installation directory to /usr/lib${LIBDIRSUFFIX}/java/:
if [ -L usr/lib${LIBDIRSUFFIX}/java ]; then
  rm -rf usr/lib${LIBDIRSUFFIX}/java
  mkdir -p usr/lib${LIBDIRSUFFIX}/java/man
  mkdir -p usr/lib${LIBDIRSUFFIX}/java/jre/lib/${LIB_ARCH}/server
  mkdir -p usr/lib${LIBDIRSUFFIX}/java/jre/lib/${LIB_ARCH}/client
  mkdir -p usr/lib${LIBDIRSUFFIX}/java/jre/javaws
  mkdir -p usr/lib${LIBDIRSUFFIX}/java/jre/bin
  mkdir -p usr/lib${LIBDIRSUFFIX}/java/bin
  mkdir -p usr/lib${LIBDIRSUFFIX}/mozilla/plugins
fi
if [ -L ControlPanel ]; then
  rm -f ControlPanel
fi
if [ -L ja ]; then
  rm -f ja
fi
if [ -L javaws ]; then
  rm -f javaws
fi
if [ -L libjsig.so ]; then
  rm -f libjsig.so
fi
# End cleanup.

if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

if [ -x /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi

EOF

# Install the desktop/mime files:
mkdir -p $PKG/usr/share/{applications,icons,mime}
cp -a $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/desktop/applications/* \
  $PKG/usr/share/applications/
cp -a $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/desktop/icons/hicolor \
  $PKG/usr/share/icons/
cp -a $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/desktop/mime/packages \
  $PKG/usr/share/mime/

# Java may not expect compressed manpages, so don't compress them.
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  $PKG/usr/lib${LIBDIRSUFFIX}/java/THIRDPARTYLICENSEREADME.txt \
  $PKG/usr/lib${LIBDIRSUFFIX}/java/LICENSE \
  $PKG/usr/lib${LIBDIRSUFFIX}/java/COPYRIGHT \
  $PKG/usr/lib${LIBDIRSUFFIX}/java/README.html \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}


brodo 09-15-2014 03:34 AM

Question to irgunII - what is the DVER value for the jdk-8u20-linux-i586.tar.gz tarball ?

I'm trying to build this version.

irgunII 09-15-2014 05:54 AM

1 Attachment(s)
Depending on what file manager you use (I use krusader exclusively) you can click once on the downloaded tarball and it will show you the files/directories that are in it. In this case it's one directory and whatever it's titled will be the DVER. The 8u20 tarball is now DVER=1.8.0_20

tronayne 09-15-2014 06:17 AM

If you're really looking for older versions of JDK they're available at http://www.oracle.com/technetwork/ja...ve-139210.html. Note, though, the warnings:
Quote:

The Oracle Java Archive offers self-service download access to some of our historical Java releases.

WARNING: These older versions of the JRE and JDK are provided to help developers debug issues in older systems. They are not updated with the latest security patches and are not recommended for use in production.
You may need to set up an Oracle account (it's free) to acquire these versions.

All that said, there really isn't a good reason to not use Java 7 (or perhaps even 8). If you have an existing Java 6 installation (the Slackware package), you can use the SlackBuild provided with, say, Slackware 14.1 to "compile" JDK 7 (you don't actually compile it, the SlackBuild just creates an installable package for you).

Older versions of Slackware are available at http://ftp.osuosl.org/pub/slackware/ and the extra directory; e.g., JDK 6 is available in that directory in the Slackware 13.37 directory. If you've lost your installed version source, you can recover from OSUOSL just to cover your bases (or select from a European mirror site rather than OSUOSL).

I have a couple of Java packages that have been upgraded from JDK 6 to JDK 7 without problems (yours may vary of course). I always install JDK rather than JRE because I need the compiler for some things. JRE is installed with JDK so if you just install JDK you won't have any problems of a missing JRE because it's there.

The SlackBuilds that come with Slackware -- that Java ones in the /extra directory in particular -- have never given me any problems keeping Java up to date though different versions. Nowadays you need to download from Oracle (because they no longer allow a distribution to bundle Java) but Slackware provides you with the tools you need (the SlackBuild) to keep everything up to date (and you simply execute the SlackBuild then upgradepkg). Too, with Slackware packages, you can remove a package and install another one in it's place and if that doesn't work simply remove the new and reinstall the older.

I will note that I have had problems with OpenJava: why, I do not know and I have just stuck with Oracle for my (rather limited) Java needs.

Hope this helps some.


All times are GMT -5. The time now is 12:17 AM.