Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
933 Views

MRAA with Java

Jump to solution

Hi all,

I'm starting to program through the Linux and discovered the MRAA lib. I managed to install on the Debian Wheezy i'm using, and seems to work fine with C/C++, the examples I compiled and executed worked. But my goal in using MRAA is Java. But everything I try to compile/execute involving of mraa and java, doesnt work. Running pre-exported JARs I get this error: java.lang.UnsatisfiedLinkError: no mraajava in java.library.path. And compiling a .JAVA through javac it doesn't find the main class ( there IS a main class - code attached). Can someone help set up the lib to use with java projects?

PS: I used this guide http://iotdk.intel.com/docs/master/mraa/building.html mraa: Building libmraa to help me build the MRAA repository

EDIT: Updated the Test.java code

 

Message was edited by: Lucas Henrique


Accepted Solutions
Highlighted
Community Manager
20 Views

Hello lucas_hms,

 

 

Using the eglibc image (which can be found in https://software.intel.com/en-us/iot/hardware/galileo/downloads https://software.intel.com/en-us/iot/hardware/galileo/downloads) I was able to install Java on my Galileo and succesfully run the hello world example found in http://introcs.cs.princeton.edu/java/11hello/HelloWorld.java.html http://introcs.cs.princeton.edu/java/11hello/HelloWorld.java.html. I you are interested in the method I used to install Java, follow these steps:

 

 

1. Go to the address /etc/opkg.

 

2. Modify the files iotdk.conf and mraa-upm.conf so they have the following content:

 

 

iotdk.conf :

 

 

src iotdk-i586 http://iotdk.intel.com/repos/3.0/iotdk/i586/ http://iotdk.intel.com/repos/3.0/iotdk/i586/

 

src iotdk-intel-core-2-32 http://iotdk.intel.com/repos/3.0/iotdk/intel_core2_32/ http://iotdk.intel.com/repos/3.0/iotdk/intel_core2_32/

 

src iotdk-quark http://iotdk.intel.com/repos/3.0/iotdk/quark/ http://iotdk.intel.com/repos/3.0/iotdk/quark/

 

src iotdk-x86 http://iotdk.intel.com/repos/3.0/iotdk/x86/ http://iotdk.intel.com/repos/3.0/iotdk/x86/

 

src iotdk-core-2-32 http://iotdk.intel.com/repos/3.0/iotdk/core2-32/ http://iotdk.intel.com/repos/3.0/iotdk/core2-32/

 

 

mraa-upm.conf:

 

 

src mraa-upm http://iotdk.intel.com/repos/3.0/intelgalactic/opkg/i586/ http://iotdk.intel.com/repos/3.0/intelgalactic/opkg/i586/

 

 

3. Type the command opkg update and let it update the repos on board.

 

4. Install the latest version available of mraa, upm and Java with the follwing command:

 

 

opkg install mraa upm openjdk-8-common openjdk-8-demo openjdk-8-doc openjdk-8-java openjdk-8-jdk openjdk-8-jre openjdk-8-source

 

 

Now you should be able to use Java on your Galileo, let me know if this helps you.

 

 

Peter.

View solution in original post

1 Reply
Highlighted
Community Manager
21 Views

Hello lucas_hms,

 

 

Using the eglibc image (which can be found in https://software.intel.com/en-us/iot/hardware/galileo/downloads https://software.intel.com/en-us/iot/hardware/galileo/downloads) I was able to install Java on my Galileo and succesfully run the hello world example found in http://introcs.cs.princeton.edu/java/11hello/HelloWorld.java.html http://introcs.cs.princeton.edu/java/11hello/HelloWorld.java.html. I you are interested in the method I used to install Java, follow these steps:

 

 

1. Go to the address /etc/opkg.

 

2. Modify the files iotdk.conf and mraa-upm.conf so they have the following content:

 

 

iotdk.conf :

 

 

src iotdk-i586 http://iotdk.intel.com/repos/3.0/iotdk/i586/ http://iotdk.intel.com/repos/3.0/iotdk/i586/

 

src iotdk-intel-core-2-32 http://iotdk.intel.com/repos/3.0/iotdk/intel_core2_32/ http://iotdk.intel.com/repos/3.0/iotdk/intel_core2_32/

 

src iotdk-quark http://iotdk.intel.com/repos/3.0/iotdk/quark/ http://iotdk.intel.com/repos/3.0/iotdk/quark/

 

src iotdk-x86 http://iotdk.intel.com/repos/3.0/iotdk/x86/ http://iotdk.intel.com/repos/3.0/iotdk/x86/

 

src iotdk-core-2-32 http://iotdk.intel.com/repos/3.0/iotdk/core2-32/ http://iotdk.intel.com/repos/3.0/iotdk/core2-32/

 

 

mraa-upm.conf:

 

 

src mraa-upm http://iotdk.intel.com/repos/3.0/intelgalactic/opkg/i586/ http://iotdk.intel.com/repos/3.0/intelgalactic/opkg/i586/

 

 

3. Type the command opkg update and let it update the repos on board.

 

4. Install the latest version available of mraa, upm and Java with the follwing command:

 

 

opkg install mraa upm openjdk-8-common openjdk-8-demo openjdk-8-doc openjdk-8-java openjdk-8-jdk openjdk-8-jre openjdk-8-source

 

 

Now you should be able to use Java on your Galileo, let me know if this helps you.

 

 

Peter.

View solution in original post