Answer the question
In order to leave comments, you need to log in
NanoHTTP web server
Hello. Downloaded from
https://github.com/NanoHttpd/nanohttpd
web server.
Now I want to compile and run it.
The file is compiled javac NanoHTTPD.java //ok
And then I want to run it:
java NanoHTTPD 8080
and I get an error:
Exception in thread "main" java.lang.NoClassDefFoundError: NanoHTTPD (wrong name
: fi/iki/elonen/NanoHTTPD)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java: 792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
2)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java. lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Answer the question
In order to leave comments, you need to log in
Because the class must be referred to by its fully qualified name, including the package.
java fi.iki.elonen.NanoHTTPD 8080
Thank you.
Now writes:
Error: Could not find or load main class fi.iki.elonen.NanoHTTPD
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question