After installing jikes (a sudo apt-get install jikes may be enough) open NetBeans. Open the Tools menu and select Options. Expand Ant and press Manage Properties button. Add the following options (the second is propably already set):
That’s it! I still get some semantic warnings, but it works just fine.