PDA

View Full Version : Java Service Problems


omar
07-15-2002, 17:43
Hi,

I have a problem when i try to create an instance for a class.
In the "Shared" tab i have:

public class ClassName
{
private ...
public ...
}


In the "Source" tab i have:
ClassName var ;
var = new ClassName() ;

When i compile the service, a message error appear
"C:\sapbc46\Server\packages\Eficentrum_PCP\code\source\Des\JService.java:85: non-static variable this cannot be referenced from a static context
a = new Encripta() ; "


Why this doesn't work ???
As always, any information is good.
Omar

omar
07-16-2002, 11:52
Hi,

I found the problem.
The class need to be STATIC.

"Shared" tag
public static class ClassName
{
...
}


Omar