Find the answer to your Linux question:
Results 1 to 7 of 7
Like Tree1Likes
  • 1 Post By atreyu
I have a pretty fresh slackware 13.37 32-bit installation and am trying to install java using a guide I can't copy as I'm not allowed to post urls below 15 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    7

    Slackbuild output "Yyyyyyyyy" when trying to build Java


    I have a pretty fresh slackware 13.37 32-bit installation and am trying to install java using a guide I can't copy as I'm not allowed to post urls below 15 posts.

    My steps:

    Code:
    wget -r -l0 -R .bin -nH --cut-dirs=5 (slackware32-bit jre link here)
    then I downloaded the 32-bit linux version of java (non rpm)

    copied it all into /jre

    I then edited jre.SlackBuild to reflect the version
    Code:
    VERSION=7u4
    DVER=1.7.0_4
    then I changed the rights, so jre.SlackBuild looks like this:
    -rwxr-xr-x

    Finally as root
    Code:
    ./jre.SlackBuild
    output an endless stream of:
    Code:
    y
    y
    y
    y
    y
    y

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    is there a line in the jre.SlackBuild script something like this?

    Code:
    yes yes | sh $( ls --indicator-style none $CWD/jre-${VERSION}-linux-${JAVA_ARCH}*.bin | tail -1) || exit 1
    the yes yes part is giving you all thoses "y"s, and i think it is doing that b/c it cannot find that jre-*.bin file that it is trying to ls? it should be in the same directory, and should be named something like:

    Code:
    jre-7u4-linux-i586*.bin
    maybe you need to download that file and put it in the same dir with that script? you would think the script would d/l it for you, but i did not see anything like that in there.

  3. #3
    Just Joined!
    Join Date
    Jan 2012
    Posts
    7
    yep, it has this

    Code:
    yes yes | sh $( ls --indicator-style none $CWD/jre-${VERSION}-linux-${JAVA_ARCH}*.bin | tail -1) || exit 1
    I just noticed, though the guide said I should get the .bin file instead of rpm, I've been using a tarball. That explains why it doesn't work. But java only seems to offer me tarballs, rpm or .exe (and I can't find the bin file within the tarball...
    I guess I'll need to find another way to get a recent version of java.

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    you can use the tarball, if you want - and don't mind doing a few manual steps.

    as a test, does this work for you?

    Code:
    # download the tarball
    wget -O jre-7u4-linux-i586.tar.gz http://javadl.sun.com/webapps/download/AutoDL?BundleId=63202
    
    # uncompress it
    tar zxf jre-7u4-linux-i586.tar.gz
    
    # run java binary command and display Java version, as a test
    jre1.7.0_04/bin/java -version
    if the last command properly spews out the Java version, then we can manually put the binaries in your path and modify/add environmental variables that need your system require.

  5. #5
    Just Joined!
    Join Date
    Jan 2012
    Posts
    7
    That seems to work fine
    Code:
    java version "1.7.0_04"
    Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
    Java HotSpot(TM) Server VM (build 23.0-b21, mixed mode)
    I presume to add it to the path:
    Code:
    export PATH=${PATH}:/home/bob/jre/jre1.7.0_04/bin/
    And from here?
    Thanks alot for helping by the way!

  6. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Ansim View Post
    I presume to add it to the path:
    Code:
    export PATH=${PATH}:/home/bob/jre/jre1.7.0_04/bin/
    sure, you could do it that way. but i would create a simple script for it that you (or any user on the system, more importantly) could source. first i'd move the directory somewhere more logical, e.g.:

    Code:
    mv /home/bob/jre/jre1.7.0_04 /opt/
    now you should have the dir:

    /opt/jre1.7.0_04/

    now with your favorite editor, create a file called "java.sh" and in it put:
    Code:
    if [ -d /opt/jre1.7.0_04/bin ]; then
      export JAVA_HOME=/opt/jre1.7.0_04/bin
      export JAVAHOME=$JAVA_HOME
      export CLASSPATH=${JAVA_HOME}/lib/ext
      export PLUGIN_HOME=${JAVA_HOME}/plugin
      echo $PATH|grep -q ${JAVA_HOME}/bin && : || export PATH=${JAVA_HOME}/bin:${PATH}
    fi
    then source it, e.g.:
    Code:
    . ./java.sh
    you should be able to echo $JAVA_HOME and run "java -version" without explicitly using the path.

    then i put this script in a directory where all files in it are sourced by users logging in. In RedHat (et al), that is in the directory /etc/profile.d/, but i'm not sure where that would be Slackware.

    for now, you could just put it in your home dir. and in your ~/.bashrc, you could put

    Code:
    . ~/java.sh
    and you should be good to go.
    Ansim likes this.

  7. #7
    Just Joined!
    Join Date
    Jan 2012
    Posts
    7
    Well I think it works, at least youtube videos are playing. But the official java test says it's not installed properly.
    I noticed there are not .bash files in the home directory besides the history
    Code:
    ls -A
    but there is a /etc/profiles.d with some .sh so I think that's the default sourcing directory. Anyway, I created a .bashrc file and added the line you quoted, which must've worked since java is effectively working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •