When I compile the ev3tools from the lejos-ev3 0.5.0-alpha release in Eclipse I get a bizarre error saying that the Java class loader cannot find the class file. Here is how I fixed that problem.

Exception in thread “main” java.lang.NoClassDefFoundError: lejos/ev3/tools/EV3Control
Caused by: java.lang.ClassNotFoundException: lejos.ev3.tools.EV3Control
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Now this left me scratching my head for a while wondering what was going on. I finally figured it out when I looked in the Problems pane in Eclipse and saw:


Ah! This is referencing Java 1.7 and I had Java 1.6 installed on my Mac. The simple solution was to download the latest JDK 1.7 from the official Java site (easier said then done) and tell Eclipse to use it by Eclipse -> Preferences -> Installed JREs and click on Search, it finds the JDK 1.7:


Right-click on the ev3control project and choose Run As… Java Application. This should start a Java app that allows you to control the EV3 remotely over wifi or Bluetooth PAN.

There is a bug in the EV3Menu code in the 0.5.0 repo, so to can make a small change to it:

Edit the file GraphicStartup.java and look on line 193. It should read:

           System.out.println(“Setting java.rmi.server.hostname to “ + lastIp);

           System.setProperty(“java.rmi.server.hostname”, lastIp);