0

i am trying to start the "Program D" from the terminal,
command in terminal "sh server.sh" gives me following error

Starting Alicebot Program D. Exception in thread "main"
java.lang.NoClassDefFoundError: org/alicebot/server/net/AliceServer
Caused by: java.lang.ClassNotFoundException:
org.alicebot.server.net.AliceServer     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:306)   at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)   at
java.lang.ClassLoader.loadClass(ClassLoader.java:247)

My Server.sh file

ALICE_HOME=.SERVLET_LIB=lib/servlet.jar
ALICE_LIB=lib/aliceserver.jar
JS_LIB=lib/js.jar

# Set SQL_LIB to the location of your database driver.
SQL_LIB=lib/mysql_comp.jar

# These are for Jetty; you will want to change these if you are using a different http         server.
    HTTP_SERVER_LIBS=lib/org.mortbay.jetty.jar:lib/javax.xml.jaxp.jar:lib/org.apache.crimson.jar

PROGRAMD_CLASSPATH=$SERVLET_LIB:$ALICE_LIB:$JS_LIB:$SQL_LIB:$HTTP_SERVER_LIBS
java -classpath $PROGRAMD_CLASSPATH -Xms64m -Xmx64m org.alicebot.server.net.AliceServer $1
pb2q
  • 58,613
  • 19
  • 146
  • 147
NickNaik
  • 3
  • 1
  • 3
  • Obvious question is, are you sure `org.alicebot.server.net.AliceServer` is in one of your .jar files? Check with `jar tf` – Sean Owen Jun 29 '12 at 21:03
  • Hi Sean, Thanks org.alicebot.server.net.aliceserver its not there as a jar file, it is a java class file rooted under "programd/src/org/alicebot/server/net/aliceserver.java" would it be alright if i use aliceserver.java instead of .jar in server.sh fil? – NickNaik Jun 29 '12 at 21:27
  • Well, that's your problem! You don't even have a compiled copy of the class available to Java. You have to feed in compiled .class files, or .jar files containing .class files. You can put the root directory of your compiler output as a classpath element. You have many errors here; you need to go back to figure out the basics of running a Java program. – Sean Owen Jun 29 '12 at 21:29

1 Answers1

2

Could this be the problem?

ALICE_HOME=.SERVLET_LIB=lib/servlet.jar

I found another question using a similar server.sh where this was on two lines:

ALICE_HOME=.
SERVLET_LIB=lib/servlet.jar

In your case SERVLET_LIB isn't getting set properly (or at all), and the embedded equal sign may be breaking PROGRAMD_CLASSPATH later on.

Community
  • 1
  • 1
John Landahl
  • 1,041
  • 5
  • 8