Thankyou for your quick reply Keke, but I believe I am :
$ java -fullversion
java full version "1.6.0_04-b12"
$ javac -version
javac 1.6.0_04
Would you be able to tell me whcih part of my problem indicated to you that
I may not be running 1.6? Perhaps this may shed some more light onto the
situation
Many thanks
"keke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Maybe you should try to use JDK 6
On Thu, Mar 6, 2008 at 11:35 AM, Marcus <[EMAIL PROTECTED]> wrote:
I think/hope that this should be a fairly simple issue to resolve... :)
I am trying to get into Restlet, and its slow work. I have been going
through
the tutorials and trying out the example code and I've hit a piece of
code
that
I can't compile.
It is in Section 3:
> // Creating a minimal Restlet returning "Hello World"
> Restlet restlet = new Restlet() {
> @Override
> public void handle(Request request, Response response) {
> response.setEntity("Hello World!", MediaType.TEXT_PLAIN);
> }
> };
I am new to Java and can only assume this 'new' instantiation syntax
creates
an inline subclass with the 'handle(..)' method overridden. I've have
knocked up some simple test code and found that you cannot define new
methods, but you can override existing ones in this manner.
It also seems that the Override annotation is unnecessary, it simply
generates a compiler error if the method doesn't infact override a
method in
the super class.
THE PROBLEM:
In the above example, I get the following error with the Override
notation:
com\firstStepsServlet\SimpleRestlet.java:22:
method does not override or implement a method from a supertype
@Override
^
The error message does not seem correct though, as I can create a new
class
that extends the Restlet class that overrides this method and uses the
Override notation, and does not generate this error. It also executes
correctly.
Any help with this would be appreciated as it seems that the tutorials
continue to use this form of syntax.
Thanks in advance
--
Cheers,
Keke
-----------------
We paranoid love life