We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Cleaned-up linux startup script (Read 2065 times)
Cleaned-up linux startup script
Feb 11th, 2008, 1:20am
 
The current startup script includes the comment "i'm a crappy bash scripter so if someone knows a more elegant way to do this, let me know" so I thought I'd throw in some suggestions.

  • If you quote everything, then it will work even if a path or file name contains spaces
  • Instead of

    Code:
    foo
    if [ $? -eq 0 ]; then ...; fi


    you can just

    Code:
    if foo; then ...; else ...; fi
  • Strings constants can contain newlines, so you don't need to repeat 'echo' on each line.


With that cleaned up, it turns into

Code:

#!/bin/sh

APPDIR="$(dirname -- "${0}")"

for LIB in \
java/lib/rt.jar \
lib \
lib/build \
lib/*.jar \
;
do
CLASSPATH="${CLASSPATH}:${APPDIR}/${LIB}"
done
export CLASSPATH

# put the directory where this file lives in the front of the path,
# because that directory also contains jikes, which we will need at runtime.
export PATH="${APPDIR}:${APPDIR}/java/bin:${PATH}"

if jikes -version > /dev/null 2> /dev/null
then
java processing.app.Base
else
echo "It appears that the version of Jikes distributed with Processing
cannot properly run on this system.

Possible solutions:

+ If you already have Jikes installed on your system, you may
just need to remove the version that is included with Processing.

+ You probably just need to track down a version of Jikes that will
work with your distribution.

+ You may need to install the rpm/package for compat-libstdc++
This is what it takes to get things running on most versions
of RedHat Linux or Fedora Core.

+ If all else fails, or if you just like building stuff yourself,
you can download the source for Jikes from SourceForge:
http://sourceforge.net/project/showfiles.php?group_id=128803
And it just takes a simple ./configure and make, followed by
copying src/jikes to the processing-XXXX folder and you should
be all set.

If you get stuck, ask questions online from the helpful folks via
the Processing discussion board: http://processing.org/discourse/

Good luck!"
fi
Re: Cleaned-up linux startup script
Reply #1 - Feb 11th, 2008, 8:16pm
 
cool, thanks for posting. i'll get these changes in for 0136 (along with some others that have been submitted).

if you think of anything else, feel free to file it as a bug so that i can get things added and track it properly.

thanks again..
Re: Cleaned-up linux startup script
Reply #2 - May 30th, 2008, 1:12am
 
now added to svn for 0137. thanks again!
Page Index Toggle Pages: 1