Sunday, August 3, 2014

Set up Java SE 8 Remote Platform on Netbeans 8 for Raspberry Pi

With Netbeans 8 installed on host computer and Java SE 8 on Raspberry Pi, we can set up remote platform on Netbeans 8. Such that we can develop Java application using Netbeans on host and deploy on Raspberry Pi remotely, all within Netbeans IDE.

It's assumed Java SE 8 have been installed on your Raspberry Pi as in last post "Install JDK 8 on Raspberry Pi and set JAVA_HOME and PATH".

In host PC (Ubuntu in my case) start Netbeans 8.

Click Tools -> Java Platforms

Click Add Platform...


Select Remote Java Standard Edition and click Next >


Name your new Remote Platform, and enter other information:
- 192.168.1.104 is the IP address of your remote Raspberry Pi.
- pi, the user in Raspberry Pi, and also enter password.
- /opt/jdk1.8.0_06 in Remote JRE Path is the JDK 8 installed location on Raspberry Pi, in last post.

(Updated@2014-09-17) for New Raspbian (2014-09-09) come with Java 8, set Remote JRE Path to default location /usr. ~ Setup Netbeans Remote Platform for default Java 8 in new Raspbian

Then finish.



This video show the steps:


Deploy Java application on Raspberry Pi remotely from Netbeans 8

Create Java Application in Netbeans as normal case. To Run it using the Remote Platform (created in previous steps):

Right click on Project -> Propertiers.

Select Run tab. Select the new created Remote Platform in Runtime Platform, and name the new Configuration.


Then you can run the application on remote Raspberry Pi by running it in this new configuration.



Once Remote Platform setup in your Netbeans IDE, you can also
development JavaFX application on Nerbeans 8, and run it remotely on Raspberry Pi
- remote debug Java program on Raspberry Pi
Cross compile Java/Swing program for Raspberry Pi



No comments: