Bug #4983
closedcannot run kepler.sh in RC2
Added by Daniel Crawl over 14 years ago. Updated over 14 years ago.
0%
Description
- /Applications/Kepler-2.0-RC2/Kepler.app/Kepler/kepler.sh
Exception in thread "main" java.lang.NoClassDefFoundError: org/kepler/build/runner/Kepler
Related issues
Updated by Daniel Crawl over 14 years ago
This works if kepler.sh/bat is in the current directory.
Updated by David Welker over 14 years ago
This bug is still true in RC 3. If you are in the same directory as kepler.sh or kepler.bat, it works, but if not, it doesn't. Is this something that should work differently?
Updated by Christopher Brooks over 14 years ago
--start--
#!/bin/sh -x
- This script starts Kepler.
- Run with -h to see all command-line options.
- This script is auto-generated by the 'ant startupScript' command
keplerScriptPath=$0
kepler=`dirname $keplerScriptPath`
java -classpath ${kepler}/build-area/lib/ant.jar:${kepler}/kepler.jar org.kepler.build.runner.Kepler "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
end-
Updated by Christopher Brooks over 14 years ago
The acceptance criteria to close this bug would be for
"ant startup-script"
to create a kepler/kepler.sh script that properly invokes Kepler
in a directory other than the kepler directory.
Also, kepler.bat should be checked and possibly fixed.
Updated by Sean Riddle over 14 years ago
I have a script that works for kepler.sh. I haven't integrated it into the startup-script target yet, though. It's attached below. Does anybody have a problem with using /bin/bash instead of /bin/sh? It's a lot easier to robustly get the location of the script with bash.
#!/bin/bash- This script starts Kepler.
- Run with -h to see all command-line options.
- This script is auto-generated by the 'ant startupScript' command
#CURDIR=`pwd`
#cd $(dirname $0)
#echo `dirname $0`
CUR_DIR=`pwd`
SCRIPT_DIR=`dirname $BASH_SOURCE`
echo $SCRIPT_DIR
cd $SCRIPT_DIR
java -classpath build-area/lib/ant.jar:kepler.jar org.kepler.build.runner.Kepler "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
echo $CUR_DIR
cd $CUR_DIR
Updated by Sean Riddle over 14 years ago
Fixed in r24623 in trunk build-area (script works from any directory on a Mac). Is there a separate 2.0 build-area that's getting used for anything?
Updated by Derik Barseghian over 14 years ago
Yes, build instructions point to: https://code.kepler-project.org/code/kepler/releases/release-branches/build-area-2.0/
Updated by Christopher Brooks over 14 years ago
Thanks for taking a look at this.
One issue is that by changing directories to the script directory,
starting java and then changing to the CUR_DIR is that
the Java process will have java.user.dir (or whatever it is)
set to the the script directory.
This would be confusing because if I start kepler.sh in a directory
and then do File|Open, I'll be in the Kepler script directory.
Most scripts, when invoked from a command line prompt, have
the current directory of the program be the directory in which the
script was invoked.
A fix would be to add SCRIPT_DIR to the classpath:
-classpath "${SCRIPT_DIR}/build-area/lib/ant.jar:${SCRIPT_DIR}kepler.jar"
Also, be sure to test your script in a directory that has spaces
in the path and a Kepler installation that has spaces in the path.