| | |
Exception in thread "main" java.lang.NoClassDefFoundError: Main/class
Thread Solved |
•
•
Join Date: Apr 2009
Posts: 7
Reputation:
Solved Threads: 0
Ok, i have read alot about this bugs now, and nothing seems to help. Hope someone have a step by step solution for me, or atleast can give me some more insight hehe 
Here is a few intel on my work.
Im working in netbeans on my labtop, uploading the .java files to an linux server, compiling, and running there.
.java and .class files are in same directory.
i have tried writing :
java -classpath . home/.../../../Main/Main
java -classpath . home/.../../../Main/Main.class
Here is my Error messages:
Here is my Code:

Here is a few intel on my work.
Im working in netbeans on my labtop, uploading the .java files to an linux server, compiling, and running there.
.java and .class files are in same directory.
i have tried writing :
java -classpath . home/.../../../Main/Main
java -classpath . home/.../../../Main/Main.class
Here is my Error messages:
Java Syntax (Toggle Plain Text)
dana@scylla:~/public_html/andersApplet/Main$ java Main.class Exception in thread "main" java.lang.NoClassDefFoundError: Main/class Caused by: java.lang.ClassNotFoundException: Main.class at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) Could not find the main class: Main.class. Program will exit.
Here is my Code:
Java Syntax (Toggle Plain Text)
/** * * @author AndersM */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { Board board = new Board(); board.testthis(); } }
For the start Applet hasn't got main() method as you know from console or GUI applications. Have look at The Life Cycle of an Applet and here you can learn more on Applets if it is what you are after...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
•
•
i know, this is the server i am creating so i can get data from another server, since it would create policy errors if i tried to connect directly to another ip then the one i am loading the applet fromthats what i have been told for sure? :-)
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
But then we are back to beginning where I said there is no main() method in applet.
Secondly what sort of connection from applet to server? What sort of server (database, web or application server)
Secondly what sort of connection from applet to server? What sort of server (database, web or application server)
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Ezzaral, AMetnik already made one post in regards of above issue yesterday, claiming above code is part of Applet (see here). Now this is creating confusion...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
Other Threads in the Java Forum
- Previous Thread: Cannot display values of the array
- Next Thread: Binary Tree and recursion
| Thread Tools | Search this Thread |
account android api applet application array arrays automation bidirectional binary birt bluetooth class classes client code columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program project property recursion ria scanner search server set sharepoint smart sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree unlimited webservices windows






thats what i have been told for sure? :-) 