Spark/trunk startup.sh problems w/ Ubuntu 10.04 (includes fix)

System specs:

  • OS: Ubuntu 10.04
  • Machine hardware: i686
  • IDE: Eclipse (Helios)
  • Java version: Java™ SE Runtime Environment (build 1.6.0_20-b02)
  • Spark version: trunk

Hello,

On compiling Spark, I found that running the startup.sh script did not work, I got the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: Caused by: java.lang.ClassNotFoundException:     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: .  Program will exit.

Investigating the script, it looks like there is a problem in the final command. I removed the unneeded quotes and it now works.

**Orginal:
**

if [ "${1}" = "-debug" ]; then java -Ddebugger=true \
-Ddebug.mode=true \
-XX:+HeapDumpOnOutOfMemoryError \
-Xdebug \
-Xint \
-server \
-Xnoagent \
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 \
"-Dappdir=${wd}" \
"${javalibrarypath}" \
-cp "${classpath}" \
${mainclass} else   java \
"-Dappdir=${wd}" \
"${javalibrarypath}" \
-cp "${classpath}" \
${mainclass} fi;

**Fixed:
**

if [ "${1}" = "-debug" ]; then java -Ddebugger=true \
-Ddebug.mode=true \
-XX:+HeapDumpOnOutOfMemoryError \
-Xdebug \
-Xint \
-server \
-Xnoagent \
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 \
-Dappdir=${wd} \
${javalibrarypath} \
-cp "${classpath}" \
${mainclass} else   java \
-Dappdir=${wd} \
${javalibrarypath} \
-cp "${classpath}" \
${mainclass} fi;

Attached is the revised script.
startup.sh (972 Bytes)

SPARK-1152

btw, mark such findings with bug or bug_report tag

thank you! you just spared me some grief:)