Archived
This forum has been archived. Please start a new discussion on GitHub.
problem in running ice program in ubuntu
hi
I am trying to run a simple server with ice on ubuntu 12.04.
I've set all the environment vars, the server was successfully compiled but when I run it I got the following errors
Exception in thread "main" java.lang.NoClassDefFoundError: Server
Caused by: java.lang.ClassNotFoundException: Server
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: Server. Program will exit.
I am trying to run a simple server with ice on ubuntu 12.04.
I've set all the environment vars, the server was successfully compiled but when I run it I got the following errors
Exception in thread "main" java.lang.NoClassDefFoundError: Server
Caused by: java.lang.ClassNotFoundException: Server
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: Server. Program will exit.
0
Comments
-
Hi Rawa,
This error means your Server class file (Server.class) is not in your CLASSPATH; it's not directly related to Ice or Ubuntu.
Cheers,
Bernard0 -
thanks for reply Bernard
I've set JAVA_HOME but now I get these errors
Exception in thread "main" java.lang.NoClassDefFoundError: Ice/LocalException
Caused by: java.lang.ClassNotFoundException: Ice.LocalException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: Server. Program will exit.
regards0 -
The problem is not related to JAVA_HOME but to how Java located classes, usually a NoClassDefFoundError exception means that the CLASSPATH isn't properly configured.
Read the following sections on the release notes:
0