Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run.sh does not work from /usr/local/bin or equivalent #60

Open
GoogleCodeExporter opened this issue Mar 24, 2016 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Install codeswarm into /usr/local/share or equivalent
2. Install or symlink run.sh from /usr/local/bin or equivalent
3. Run codeswarm

What is the expected output? What do you see instead?

Codeswarm should run, fails to find jar 

"ERROR, please verify 'ant' and 'java-sdk' installation" 

What version of the product are you using? On what operating system?

Latest trunk 

Patch attached to resolve this. Used the code from the ant project's launcher 
script 
(ANT_HOME/bin/ant). Not sure if that causes a license problem? Also only tested 
on OS X.

Cheers,

Matt

matth@macbook matth$ svn diff run.sh 
Index: run.sh
===========================================================
========
--- run.sh  (revision 273)
+++ run.sh  (working copy)
@@ -1,9 +1,25 @@
 # run.sh : code_swarm launching script
 # need the config file as first parameter

+## Get codeswarm dir, resolving symlinks
+PRG="$0"
+progname=`basename "$0"`
+
+# need this for relative symlinks
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+  PRG="$link"
+  else
+  PRG=`dirname "$PRG"`"/$link"
+  fi
+done
+
+codeswarm_dir=`dirname $PRG`
 params=$@
-default_config="data/sample.config"
-code_swarm_jar="dist/code_swarm.jar"
+default_config="$codeswarm_dir/data/sample.config"
+code_swarm_jar="$codeswarm_dir/dist/code_swarm.jar"

 # command line parameters basic check
 if [ $# = 0 ]; then
@@ -48,7 +64,7 @@
 fi

 # running
-if java -Xmx1000m -classpath 
dist/code_swarm.jar:lib/core.jar:lib/xml.jar:lib/vecmath.jar:. 
code_swarm $params; then
+if java -Xmx1000m -classpath 
$codeswarm_dir/dist/code_swarm.jar:$codeswarm_dir/lib/core.jar:$codeswarm_dir/li
b/xml.jar:$
codeswarm_dir/lib/vecmath.jar:$codeswarm_dir:. code_swarm $params; then
 # always on error due to no "exit buton" on rendering window
     echo "bye"
 #    echo -n "error, press a key to exit"




Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 26 Apr 2009 at 9:34

@GoogleCodeExporter
Copy link
Author

On Ubuntu 10.04, I changed JAVA_HOME to
export JAVA_HOME=/usr/lib/jvm/java-6-sun/
to make it work

Original comment by [email protected] on 8 Sep 2010 at 9:47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant