I'm interested is it possible to compile Java code to native code so that I can run it on some cheap board like Arduino or Raspberry pi?
What compiler can you recommend?
Yes, you can compile java code to native for example using
gcj and run it on Raspberry Pi. But you can also run a complete java stack on the pi, no problem.
You will need to update the Arduino firmware first though:
Before using JArduino, please make sure your Arduino board contains the JArduino firmware:
- Copy the JArduino folder (located in the distribution in
- Launch your Arduino environment
- File -> Examples -> JArduino -> JArduino firmware. It should open an Arduino program that you should upload to your board using the normal Arduino procedure.
- Your Arduino board is now ready for Jarduino. You can exit the Arduino environment forever and launch Eclipse. Just run the Java/JArduino program.