Uh… and when I thought I’ve seen it all.
This is my first error of this kind, what does it mean? I can’t call methodes like this (in definition)?
[quote=“Eclipse Error”]Cannot refer to a non-final variable network inside an inner class defined in a different method
[/quote]
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
running = false;
network.stopServer(); // - THE ERROR HERE
System.out.println("Shutdown hook executed");
finishOff();
}
});