ADC, for the sample mentionned below.
With the limited amount of RAM available on the Raspberry PI, there is just no way to run modern IDEs on it.
It just does not make any sense.
People develop on another box - with more RAM - and eventually upload the compiled classes on the Raspberry PI, where they can be run.
And that works.
Until you need the debugging capabilities you are used to...
The Java Platform Debugging Architecture (JPDA) makes remote debugging possible.
All you need is to see the Raspberry PI on the network your IDE runs on, as we will demonstrate.
We will show how to achieve this from JDeveloper.
I use JDeveloper for all my PI4J developments, because:
We assume that you have compiled the classes you want to debug from your IDE (JDeveloper in this case), and uploaded the generated classes on the Raspberry PI.
battery.monitor, modify the line that says:
sudo java -cp $CP adc.sample.BatteryMonitor $*into
sudo java -client -agentlib:jdwp=transport=dt_socket,server=y,address=1044 -cp $CP adc.sample.BatteryMonitor $*Notice the port, it is 1044. You can change that value at your leisure, as long as the port is available.
Prompt> ./battery.monitor Read an ADC Listening for transport dt_socket at address: 1044
Run/Debugsection, and do check the
Next go to the
Tools Settings | Debugger | Remotesection, and set the host and port appropriately.
raspberrypiis the name of the Raspberry PI on the network, and that
1044is the port we used on the Raspberry PI to start the application.
You're prompted to confirm your options...
And that's it! The debugger stops when a breakpoint is hit. You can see - and change - the values of your variables, go step by step, and make anything the debugger allows you to do.
Such features exist in all Java IDEs. Just look for them if JDeveloper is not the one you use.
jconsoleis a utility that comes with the Java Devlopment Ket (JDK). It can be used to profile a Java Virtual Machine (JVM) instance, locally, or remotely.
JAVA_OPTIONS="$JAVA_OPTIONS -Dcom.sun.management.jmxremote.port=1234 \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false \ -Djava.rmi.server.hostname=raspberrypi-boat"The port and the hostname need to match your environment, of course.
jconsole. It is in