You are not logged in.

#1 2008-05-27 19:27:09

The Avatar of Time
Member
Registered: 2008-01-11
Posts: 226

Configure Java?

I need to switch the version of Java that I am using.

I found Ubuntu instructions for it:

sudo apt-get install ia32-sun-java6-bin

sudo update-alternatives --config java

Then choose the ia32 version of Java 6.

When I try to:

sudo pacman -S ia32-sun-java6-bin

and

sudo update-alternatives --config java

I get package not found and command not found.

How would I do this in Arch? Thanks for any help.

Offline

#2 2008-05-27 20:26:46

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Configure Java?

I can't help you with the version of Java that you're trying to install, but have you looked into IcedTea6 or OpenJDK7 for 64 bit (of course I'm assuming 64 bit). There was a bit of a discussion here about not only compiling it, but the links to the packages in the French-Arch repos:

http://bbs.archlinux.org/viewtopic.php?id=46878

Offline

#3 2008-05-28 12:27:52

Janax
Member
From: Iowa
Registered: 2007-05-21
Posts: 86

Re: Configure Java?

You might also try the 32-bit version for x86_64 on AUR.  If you haven't used it before, get 'yaourt' from here first and use it to fetch/install all the pre-requisites for AUR packages - it makes life much, much easier.  I use the 32-bit installation because I still can't get the Iced-Tea version to run my Java web-start stuff that I need to run at work.

Good luck!

Offline

#4 2008-05-28 17:52:09

The Avatar of Time
Member
Registered: 2008-01-11
Posts: 226

Re: Configure Java?

Thanks for the replies.

The 32-bit version of Java is exactly what I need. Or at least it solved the problem back when I used Ubuntu. It is a Frostwire problem that I am working on.

Yes I have yaourt, which is just excellent. I did a 'yaourt -S lib32-jdk' which seemed to be the proper package from the link that you posted. Things seemed to go smooth but at the end of the installation I get:

loading package data...
checking dependencies...
error: replacing packages with -A and -U is not supported yet
error: you can replace packages manually using -Rd and -U
error: failed to prepare transaction (conflicting dependencies)
:: lib32-jdk: conflicts with jre
==> WARNING: Your package is saved in /tmp/lib32-jdk-6.0u5-1-x86_64.pkg.tar.gz
If you like this package, please install aurvote
and vote for its inclusion/keeping in [community]

I am not experienced with Yaourt or AUR yet so I don't know if the package actually installed and if so did it replace the 64-bit Java as the default?

Offline

#5 2008-05-28 18:23:39

The Avatar of Time
Member
Registered: 2008-01-11
Posts: 226

Re: Configure Java?

Okay, I used pacman to remove Frostwire and jre, then installed lib32-jdk with yaourt. It seemed to work fine this time, no errors. Then I used pacman to reinstall Frostwire.

Now when I attempt to start Frostwire I get:

Something went wrong with FrostWire.
Maybe you're using the wrong version of Java?
(FrostWire is tested against and works best with with Sun's JRE, Java 1.4+)
The version of Java in your PATH is:
./runFrostwire.sh: line 134: java: command not found

So I look into /usr/share/frostwire/runFrostwire.sh:

#!/bin/bash
#
# Runs FrostWire.  This script must be executed in your FrostWire
# install directory.

# this should allow starting limewire from
# gui-based explorer interfaces
cd "`dirname "$0"`"

export AWT_TOOLKIT=MToolkit
export HOSTNAME=localhost

# try to discover java
MSG0="Loading FrostWire:"
MSG1="Starting FrostWire..."
MSG2="Java exec found in "
MSG3="OOPS, your java version is too old "
MSG4="You need to upgrade to JRE 1.5.x or newer from http://www.java.com"
MSG5="Suitable java version found "
MSG6="Configuring environment..."
MSG7="OOPS, you don't seem to have a valid JRE. FrostWire works best with Sun JRE available at http://www.java.com "
MSG8="OOPS, unable to locate java exec in "
MSG9=" hierarchy"
MSG10="Java exec not found in PATH, starting auto-search..."
MSG11="Java exec found in PATH. Verifying..."

look_for_java()
{
 JAVADIR=/usr/lib  
 if look_for_javaImpl ; then
    return 0
 fi 
 JAVADIR=/usr/java
 if look_for_javaImpl ; then
       return 0
 fi
 JAVADIR=/opt
 if look_for_javaImpl ; then
       return 0
 fi
 return 1
}

look_for_javaImpl()
{
  IFS=$'\n'
  potential_java_dirs=(`ls -d1 "$JAVADIR"/j* | sort | tac`)
  for D in "${potential_java_dirs[@]}"; do
    if [[ -d "$D" && -x "$D/bin/java" ]]; then
      JAVA_PROGRAM_DIR="$D/bin/"
      echo $MSG2 $JAVA_PROGRAM_DIR
      if check_version ; then
    return 0
      fi
    fi
  done
  echo $MSG8 "${JAVADIR}/" $MSG9 ; echo $MSG4
  return 1 
}

check_version()
{
  # short-circuit gcj
  ISGCJ=`${JAVA_PROGRAM_DIR}java -version 2>&1 | grep -i gcj`
  if [ "$ISGCJ" != "" ] ; then
      echo $MSG7
      return 1
  fi

  JAVA_HEADER=`${JAVA_PROGRAM_DIR}java -version 2>&1 | grep version`
  JAVA_IMPL=`echo ${JAVA_HEADER} | cut -f1 -d' '`
  if [ "$JAVA_IMPL" = "java" ] ; then
    VERSION=`echo ${JAVA_HEADER} | sed "s/java version \"\(.*\)\"/\1/"`
    if echo $VERSION | grep "^1.[0-4]" ; then
      echo $MSG3 "[${JAVA_PROGRAM_DIR}java = ${VERSION}]" ; echo $MSG4
      return 1
    else
      echo $MSG5 "[${JAVA_PROGRAM_DIR}java = ${VERSION}]" ; echo $MSG6
      return 0          
    fi
  else
    echo $MSG7 "[${JAVA_PROGRAM_DIR}java = ${JAVA_IMPL}]" ; echo $MSG4
    return 1
  fi
}

echo $MSG1

# locate and test the java executable
if [ `uname` = "Linux" ]; then
  if ! command -v java &>/dev/null; then
    echo $MSG10
    if ! look_for_java ; then
      exit 1
    fi
  else
    echo $MSG11
    if ! check_version ; then
      if ! look_for_java ; then
        exit 1
      fi
    fi
  fi
else
  JAVA_PROGRAM_DIR=""
fi

echo $MSG0

export J2SE_PREEMPTCLOSE=1

# if the invoking script provided us with an executable, pass it along
if echo "$1" | grep -q "\-Dunix.executable="
then
  EXECUTABLE=$1
  ARGUMENTS="$2 $3 $4 $5"
else
  # there was no executable, so just pass whatever arguments there were along
  EXECUTABLE=""
  ARGUMENTS=$*
fi

export LD_LIBRARY_PATH=`pwd`

${JAVA_PROGRAM_DIR}java -ea -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog -Djava.library.path=. $EXECUTABLE -jar FrostWire.jar $ARGUMENTS
if [ $? -ne 0 ]; then
    echo 
    echo ${JAVA_PROGRAM_DIR}
    echo "******************************************************************"
    echo "Something went wrong with FrostWire."
    echo "Maybe you're using the wrong version of Java?"
    echo "(FrostWire is tested against and works best with with Sun's JRE, Java 1.4+)"
    echo "The version of Java in your PATH is:"
    java -version   ####This is line 134####
    echo 
fi

Line 134 is 'java -version' which I marked in the code, just here, not in the real file.

So what do I do to tell Frostwire to use the 32-bit Java?

Thanks for the help.

Offline

#6 2008-05-29 18:05:23

Janax
Member
From: Iowa
Registered: 2007-05-21
Posts: 86

Re: Configure Java?

You probably need to run the command:

$ source /etc/profile

Your system probably is using the old environment location for Java instead of the new 32-bit version's location.  If you type 'which java' and it doesn't say '/opt/java32/bin/java', then your ENV isn't set up correctly.

Offline

#7 2008-05-29 20:55:40

The Avatar of Time
Member
Registered: 2008-01-11
Posts: 226

Re: Configure Java?

Thanks for the reply. I did a 'source /etc/profile' and ran Frostwire. Here is what I got.

[theavataroftime@Imladris ~]$ frostwire
Starting FrostWire...
Java exec found in PATH. Verifying...
Suitable java version found [java = 1.6.0_05]
Configuring environment...
Loading FrostWire:
java.lang.UnsatisfiedLinkError: /opt/java32/jre/lib/i386/motif21/libmawt.so: libXp.so.6: wrong ELF class: ELFCLASS64
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1005)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1030)
    at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.loadLibraries(Toolkit.java:1594)
    at java.awt.Toolkit.<clinit>(Toolkit.java:1616)
    at com.limegroup.gnutella.gui.Main.showInitialSplash(Main.java:67)
    at com.limegroup.gnutella.gui.Main.main(Main.java:39)


******************************************************************
Something went wrong with FrostWire.
Maybe you're using the wrong version of Java?
(FrostWire is tested against and works best with with Sun's JRE, Java 1.4+)
The version of Java in your PATH is:
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)

It looks to me like Frostwire is looking in the wrong place for Java. But I really have no idea. Any ideas anyone? Thanks.

Offline

#8 2008-05-30 13:06:41

Janax
Member
From: Iowa
Registered: 2007-05-21
Posts: 86

Re: Configure Java?

OK - now it looks like you're missing a 32-bit library.  I tried to catch them all when I made the package, but I guess I missed one.  From your error message, I'd guess you need to install 'lib32-libxp'.  When I look for it, I see:

$ pacman -Ss lib32-libxp
archlinuxfr/lib32-libxp 1.0.0-1
    X11 X Print Library

So you will want to add the archlinuxfr repository if you haven't already...

Good luck once again!

Offline

#9 2008-05-30 16:44:24

The Avatar of Time
Member
Registered: 2008-01-11
Posts: 226

Re: Configure Java?

Thank you kindly, Frostwire is now working. However, it is going really, really, really, slow. Takes about five minutes to startup after the splash screen comes up. This is not an issue with my computer being slow. smile

I ran into the same problem with another 'fix' that I had found: http://bbs.archlinux.org/viewtopic.php? … 31#p373131

Where you saved a 'frostwire.sh' in the home folder and ran it with 'sh frostwire.sh'. It basically told Frostwire to get Java from another path, if I remember right. It made Frostwire work too, with the same five minute delay.

Any ideas as to how I would make Frostwire launch at a normal speed? Thanks.

Last edited by The Avatar of Time (2008-05-30 19:35:24)

Offline

Board footer

Powered by FluxBB