Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 6772|Reply: 5

Embedded Java8 and Netbeans

[Copy link]

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
Post time 2016-2-17 23:02:56 | Show all posts |Read mode
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
Copy the Code

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
Copy the Code

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
Copy the Code

And then
  1. sudo update-alternatives --config javac
  2. sudo update-alternatives --config java
Copy the Code

After all, verify with the commands with -version option.
  1. java -version
  2. javac -version
Copy the Code

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
Copy the Code

After that ,to run Netbeans you have to type
  1. ./netbeans
Copy the Code

Then you can install modules and plugin for several language such C/C++, PHP and java of course
It's working well .
ciao
Walter

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-20 09:41:59 | Show all posts
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
Copy the Code

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/"
Copy the Code

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
ciao

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-20 23:28:22 | Show all posts

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-22 09:49:13 | Show all posts
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 "

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-23 21:21:33 | Show all posts
ok it works
Reply

Use magic Report

17

Threads

83

Posts

382

Credits

Intermediate member

Rank: 3Rank: 3

Credits
382
 Author| Post time 2016-2-24 11:13:21 | Show all posts
Edited by xwalter at 2016-2-24 22:28

Communication between orange pi and Visual Studio 2015 over the serial port
https://youtu.be/Vz00VZiCzcY
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-10-15 05:29 GMT+8 , Processed in 0.030521 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list