0

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.

jdonald
  • 670
  • 7
  • 15
tb96
  • 265
  • 2
  • 4
  • 17
  • 1
    Consider building all your dependencies into a single jar. This is fairly common practice to avoid situations like you're now fighting against. It's usually called a "fat jar". https://stackoverflow.com/questions/19150811/what-is-a-fat-jar – mkasberg Feb 07 '19 at 22:48
  • 1
    Since Java programs run on the JVM, it's unlikely that any of your errors are related to the host OS (although it's _possible_ that they could be due do a different version of Java that is installed). Generally speaking, if Java runs on the OS, java applications won't have any problems. – mkasberg Feb 07 '19 at 22:50

1 Answers1

0

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.

tb96
  • 265
  • 2
  • 4
  • 17