Professional Documents
Culture Documents
Compile JAVA API On Raspberry Pi
Compile JAVA API On Raspberry Pi
Ensure you have Java in your Pi, if you do not have please follow below steps:
1) Download the latest mercuryapi available from the ThingMagic website using the below link:
https://www.jadaktech.com/documentation/rfid/mercuryapi/
2) Copy Mercury API SDK to Raspberry Pi and extract the API SDK using unzip command(as
shown in below example).
sudo unzip mercuryapi-1.31.1.36.zip -d ./mercuryapi-1.31.1.36
4) Copy read.java to Java folder using below command(you can use the below command when
you are in folder “java/samples_nb/src/samples”)
cp read.java ../../../
5) Go to Java folder and compile the application using the following command.
javac -cp .:ltkjava-1.0.0.6.jar:mercuryapi.jar <sampleapplication.java>
Example: sudo javac -cp .:ltkjava-1.0.0.6.jar:mercuryapi.jar read.java
6) The general error you could see if when Java complains about missing linux-arm.lib. When
Java complains about missing linux-arm.lib, it can't find the required libraries for using the serial
ports on your system. Here is how to recompile them:
• Now you will have a folder named “com” in the current(java) folder.
• Copy the mercuryapi.jar file from the java directory into com/thingmagic(using below
command).
cp mercuryapi.jar ./com/thingmagic/
• Copy the linux-arm.lib file you created before into java/com/thingmagic (there are a few
other .lib files there).
7) Run the application using following command.
sudo java -cp .:ltkjava-1.0.0.6.jar:mercuryapi.jar <sampleapplication> <comport> <--ant
1,2>
Example: sudo java -cp .:ltkjava-1.0.0.6.jar:mercuryapi.jar read tmr:///dev/ttyACM0 --ant 1