Win a copy of Rust Web Development this week in the Other Languages forum!

Stoian Ovidiu

Greenhorn
+ Follow
since Jul 07, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stoian Ovidiu

I have this code:


if I want to compile:

HelloWorld.java:6: package javax.servlet does not exist
import javax.servlet.ServletException;
^
HelloWorld.java:7: package javax.servlet.annotation does not exist
import javax.servlet.annotation.WebServlet;
^
HelloWorld.java:8: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
^
HelloWorld.java:9: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
^
HelloWorld.java:10: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
^
HelloWorld.java:16: cannot find symbol
symbol: class HttpServlet
public class HelloWorld extends HttpServlet {
^
HelloWorld.java:15: cannot find symbol
symbol: class WebServlet
@WebServlet("/HelloWorld")
^
HelloWorld.java:30: cannot find symbol
symbol : class HttpServletRequest
location: class HelloWorld
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:30: cannot find symbol
symbol : class HttpServletResponse
location: class HelloWorld
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:30: cannot find symbol
symbol : class ServletException
location: class HelloWorld
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:38: cannot find symbol
symbol : class HttpServletRequest
location: class HelloWorld
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:38: cannot find symbol
symbol : class HttpServletResponse
location: class HelloWorld
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:38: cannot find symbol
symbol : class ServletException
location: class HelloWorld
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
13 errors


10 years ago
Why don`t complie a while after while in the some method?
If i set a class reference in main method and after while I access a method from class reference return compile error.

Ex:

Ex:
12 years ago
13 years ago
many thanks.
Now works.
java -classpath c:\groovy.jar;c:\lib hello
13 years ago
How to run a groovy code with java ?
I have a simple groovy code:
println "Hello World!"

After compiling code:
groovy hello.groovy
result hello.class

If i want to run the code with java, this byte cod don`t work
java hello

Error:
C:\>java hello
Exception in thread "main" java.lang.NoClassDefFoundError: groovy/lang/Script
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Caused by: java.lang.ClassNotFoundException: groovy.lang.Script
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 12 more

If I classpath my lib like:
java -classpath c:\lib c:\hello

Error:

C:\>java -classpath c:\lib\ c:\hello
Exception in thread "main" java.lang.NoClassDefFoundError: c:\hello
Caused by: java.lang.ClassNotFoundException: c:\hello
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Why don`t work ?

c:\lib is lib of groovy.
c:\hello is a class hello world.
[ July 07, 2008: Message edited by: Bro Fratello ]
13 years ago