Archived
This forum has been archived. Please start a new discussion on GitHub.
Running error in JAVA hello world demo
Hello,
I am new to ice and java.
I get below errors even after setting my classpaths in helloworld java application.
MY classpaths are set like this in environment variables.
CLASSPATH="/usr/share/java/Ice.jar:."
Exception in thread "main" java.lang.NoClassDefFoundError: class
Caused by: java.lang.ClassNotFoundException: class
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: class. Program will exit.
My Server.class and Client.class are already created in classes directory. I am using UBUNTU system for execution.
I tried going into classes directory and executing java Server/Client command but output remains the same.
Any clues or am i missing anymore path settings?
- Prasad
I am new to ice and java.
I get below errors even after setting my classpaths in helloworld java application.
MY classpaths are set like this in environment variables.
CLASSPATH="/usr/share/java/Ice.jar:."
Exception in thread "main" java.lang.NoClassDefFoundError: class
Caused by: java.lang.ClassNotFoundException: class
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: class. Program will exit.
My Server.class and Client.class are already created in classes directory. I am using UBUNTU system for execution.
I tried going into classes directory and executing java Server/Client command but output remains the same.
Any clues or am i missing anymore path settings?
- Prasad
0
Comments
-
Hello Prasad,
This is a pure Java issue - nothing to do with Ice, and probably nothing to do with your CLASSPATH. I can reproduce this very easily:$ java class Exception in thread "main" java.lang.NoClassDefFoundError: class Caused by: java.lang.ClassNotFoundException: class 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: class. Program will exit.
Cheers,
Bernard0