[aklug] Re: Java Question - Jin

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Wed Apr 01 2009 - 11:55:12 AKDT

On Tue, 31 Mar 2009, Christopher Howard wrote:

> Hi. I'm trying to get Jin (Java chess client) to run. It won't run because
> it needs to be using Sun Java instead of the GNU java implementation. I
> installed Sun Java 6 jre, but the program doesn't seem to know that.

If you've installed the Sun JRE into /usr/java, just add the following lines
to your script:

> Here is the script that starts the program:
>
> ######
>
> #!/bin/sh

export JAVA_HOME=/usr/java
export PATH=$JAVA_HOME/bin:$PATH

> # Java command
> JAVA_CMD=/usr/java/bin/java
            ^^^^^^^^^^^^^^^^^^

You should be golden at this point.

> # Check if GCJ
> $JAVA_CMD -version 2>&1 | grep -i -q "gcj\|gnu\|gij"
> if [ $? -eq 0 ]
> then
> echo "You seem to be running GNU's Java implementation, which is
> incomplete."
> echo "Jin requires Sun's Java (or a fully compatible version) 1.4
> or later."
> echo "If you can't install it with your distribution's package
> manager, you"
> echo "can obtain and install it manually from http://www.java.com"
> exit
> fi
>
> # Follow links
> filename=`readlink -f $0`
> if [ -z "$filename" ]
> then
> filename=$0
> fi
>
> # Change to Jin's directory - Jin needs to be run from its directory
> cd `dirname $filename`
>
> # Run Jin
> $JAVA_CMD $JAVA_OPTS -jar jin.jar $*
>
> ######
>
> I commented out the part which checks the Java version, but then the
> program just starts but crashes immediately. How can I adjust this so that
> it uses Sun Java?
>
> --
> Christopher Howard
> http://indicium.us
> http://theologia.indicium.us
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>

         --Arthur Corliss
           Live Free or Die
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Apr 1 11:55:23 2009

This archive was generated by hypermail 2.1.8 : Wed Apr 01 2009 - 11:55:23 AKDT