PDA

View Full Version : How to associate a run.jar file with Java


frazelle09
14-February-2007, 01:37
i've got a Genealogy program which was working but somehow seems to have stopped working. It has .bat, .cmd, .jar and .sh run files and i understand that it runs under Java but don't know how to get any of these files to run any more. i understand that the .bat and .cmd files are probably for Windows and the Readme file says the following...

Execute one of the start-scripts in the main application folder:

run.sh Unix
run.cmd OS2/Windows
run.bat Windows

If jar-files are associated with 'javaw' on your system a simple
double-click on run.jar is sufficient (the association has to
be set up to call 'javaw -jar %1').

Any ideas on how to proceed?

Have a great evening! :)

DrHu
14-February-2007, 08:06
If jar-files are associated with 'javaw' on your system a simple
double-click
javaw is a windows java file.. http://forum.java.sun.com/thread.jspa?threadID=5118123
http://forum.java.sun.com/thread.jspa?threadID=483384&messageID=2256995

Try changing javaw (windows command) to java (java, linuxcommand)
/usr/bin/java
/usr/bin/javaws
/usr/bin/java_vm

Tried out
--but I don't use java except for plugin use, and do not normally have it running..
/usr/bin/javaws
tux:~# Java Web Start splash screen process exiting ...
Bad installation: JAVAWS_HOME not set
http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/javaws.html

frazelle09
15-February-2007, 04:21
Thanks, DrHu! Wouldn't you think that simply running (double click) on the run.sh file would be sufficient? The following is what is inside the run.sh script...

#!/bin/sh

# GenJ has to be run from inside it's installation directory
# so change into directory where this script was started
cd `dirname $0`

# check the script for being a symbolik link we can follow
SCRIPT=`basename $0`
while [ -h "$SCRIPT" ]; do
SCRIPT=`ls -l $SCRIPT | grep -o '[/.[:alnum:]]*$'`
echo "*** INFO: Following symlink $SCRIPT"
cd `dirname $SCRIPT`
SCRIPT=`basename $SCRIPT`
done

# final check if the GenJ main archive is right here
if [ ! -f "./run.jar" ]; then
echo "*** ERROR: Missing GenJ resource(s) in "`pwd`
exit 1
fi

echo "*** INFO: Running GenJ from"`pwd`

# find java
JAVA=$JAVA_HOME/bin/java
if [ ! -x "$JAVA" ]; then
JAVA=`which java`
if [ $? -eq 1 ]; then
echo "*** ERROR: Can't find java executable"
exit 1
fi
fi

# run it (we start the virtual machine with initially 32 MB and allocate a max of 512 MB)
CMD="$JAVA -Xmx512m -Xms32m -jar run.jar"

echo "*** INFO: Executing '$CMD'"

$CMD


Have a great evening! :)