Search code examples
javaraspberry-pijacksonraspbiandropbox-api

Loading libraries on Raspbian


I'm running a Java application on the Raspberry Pi 3B, my OS is Raspbian. The application (which has been written on a x64 Windows system) relies on the Dropbox Core sdk-3.0.6 to download some data from a Dropbox server. The Dropbox Core SDK needs another library called the Jackson Core 2.7.4 SDK.

I've imported both jar.files to the directory /home/lib/. I'm running the application from the following .bat file:

> java -cp /home/lib/jackson-core-2.7.4.jar;/home/lib/dropbox-core-sdk-3.0.6.jar   -jar /home/ComRoll.jar

I keep on getting errors because of these libraries. Most common error is concering the jackson library: "Cannot execute binary file". Something that's maybe worth mentioning is that the error message differs depending on the order of the libraries in the .bat file. When I construct the file in the following way there are other messages:

> java -cp /home/lib/dropbox-core-sdk-3.0.6.jar;/home/lib/jackson-core-2.7.4.jar   -jar /home/ComRoll.jar

I'm new to Linux-based systems and hoping I'm missing something really obvious here because I'm starting to fear that the entire Dropbox SDK wouldn't be eligible for Raspberry Pi.


Solution

  • The comments of mkasberg pointed me in the right direction. I built a fat jar with the libraries I used during development on the Windows system. Eventually there were some problems with that approach too: some of the libraries were signed. I excluded those libraries from the project and now the fat jar seems to be running smooth on the raspberry.