Forum > Other languages
xwalter 看全部
2016-2-17 23:02:56
Edited by xwalter at 2016-2-17 23:11

I use java 8 and Netbeans to develop with my orange pi plus 2
Following this istructions I hope you get help .
First of all you have to update and upgrade your system by typing


  1. sudo apt-get update
  2. sudo apt-get upgrade

Download the embedded java 8 jdk from Oracle at  http://www.oracle.com/technetwor ... nloads-2133151.html
Select jdk-1.8.0_73-linux-arm32-vfp-hflt.tar.gz and download it into Downloads folder
Move the terminal in this folder and type


  1. sudo tar zxvf jdk-8u73-linux-arm32-vfp-hflt.tar.gz -C /opt

Set default java and javac to the new installed jdk8.


  1. sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_73/bin/javac 1
  2. sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_73/bin/java 1

And then


  1. sudo update-alternatives --config javac
  2. sudo update-alternatives --config java

After all, verify with the commands with -version option.


  1. java -version
  2. javac -version

Now you can download and install Netbeans 8 as well , to this link https://netbeans.org/downloads/index.html
Download the complete version with Platform  " OS indipendent zip"
Navigate to Download folder again and unzip the netbeans.8.1.xxxxx.zip  file .
Navigate until ...../home/orangepi/<yournetbeansfolder>/bin
Give the permission and the file executable with


  1. chmod +x netbeans

After that ,to run Netbeans you have to type


  1. ./netbeans

Then you can install modules and plugin for several language such C/C++, PHP and java of course
It's working well .
xwalter 看全部
2016-2-20 09:41:59
Edited by xwalter at 2016-2-20 09:48

Carry on and let's use the serial port of our orangepi .
After install java jdk 8 and Netbeans and both working , now we want to use the serial port
First of all .....


  1. sudo apt-get install librxtx-java

This will install the tool and you will find the RXTXcomm.jar into  /usr/share/java
You have to add this library in Netbeans as external jar/folder
But for the runtime it needs also a .so file which is the same like .dll in windows .
so=shared object , is a dinamically library used at runtime which connects itself to the device driver.
After many nightmares and troubles I have found the best solution for that .
After the installation of the library you will also find  into  /usr/lib/jni a lot of .so files but what you are interested is the librxtxSerial.so.
The problem is that Netbeans search this .so file somewhere like java.library.path and I didn't solve these issues. But I solved int his way ....
In Netbeans , right click above your project (in the tree at left) and select
-> Properties -> Run -> VM Options  (is a richtext box ) and to add this line


  1. -Djava.library.path="/usr/lib/jni/"

Click ok and go out and all is done.
Now if you run your project everythings  are ok .
Here you can find a complete project which uses the serial port by using threading technique as well.
http://rxtx.qbang.org/wiki/index ... ith_the_serial_port
xwalter 看全部
2016-2-20 23:28:22
xwalter 看全部
2016-2-22 09:49:13
now the problem is how to unlock the  ttyS0 in the system.
I'm trying with gtkterm , minicom and else but nothing to do
The serial port of orangepi is sleeping , it doesn't receive and it doesnt'show me anything on the screen .
Where to find the file and set "I Want to use my serial port "
xwalter 看全部
2016-2-23 21:21:33
ok it works

OrangePi En

Powered by Discuz! X3.4

homepage|Simple edition|Touch edition|PC