I am creating a Jetty project, as a learning experience. I’m 15 and just exploring the programming world and looking to find something I like, and taking in as much information as I can along the way.
I have just started creating my Jetty server following this tutorial, http://wiki.eclipse.org/Jetty/Tutorial/Jetty_HelloWorld
I have reached the final step and am trying to start my server with
java -cp jetty-all.jar:servlet-api-2.5.jar HelloWorld
I am trying to run it on a Mac and this is my error message
Error: Could not find or load main class HelloWorld
Does anyone know what could be causing this? I have already compiled the HelloWorld.java file and used
javac -cp servlet-api-2.5.jar:jetty-all.jar HelloWorld.java
Can anyone help with this issue?
Thanks in advance. I just need to be pointed in the right direction here. 🙂
-Henry Harris
If you did the javac command as the tutorial, try this command line…
Notice the extra
:.piece, that will also use the current directory to find the HelloWorld.class file.