Project

General

Profile

Bug #4983

cannot run kepler.sh in RC2

Added by Daniel Crawl over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
execution engine
Target version:
Start date:
05/07/2010
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
4983

Description

  1. /Applications/Kepler-2.0-RC2/Kepler.app/Kepler/kepler.sh
    Exception in thread "main" java.lang.NoClassDefFoundError: org/kepler/build/runner/Kepler

Related issues

Blocked by Kepler - Bug #4943: RC5 Installer Tracking BugResolved04/19/2010

History

#1 Updated by Daniel Crawl over 9 years ago

This works if kepler.sh/bat is in the current directory.

#2 Updated by David Welker over 9 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?

#3 Updated by Christopher Brooks over 9 years ago

This works for me:
--start--
#!/bin/sh -x
  1. This script starts Kepler.
  2. Run with -h to see all command-line options.
  3. 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-

#4 Updated by David Welker over 9 years ago

Should I close this bug?

#5 Updated by Christopher Brooks over 9 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.

#6 Updated by Sean Riddle over 9 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
  1. This script starts Kepler.
  2. Run with -h to see all command-line options.
  3. 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

#7 Updated by Sean Riddle over 9 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?

#9 Updated by Sean Riddle over 9 years ago

Okay, patched in branch as well.

#10 Updated by Christopher Brooks over 9 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.

#11 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 4983

Also available in: Atom PDF