0

OK. Let me start. I am busy making a musical floppy player, connected everything up to my Raspberry Pi, and wrote a Java program to control it. I used OpenJDK 7 on Raspbian Jessie Lite. Then I took a break from the Pi, and continued the program on my workstation. When I loaded it onto the Pi, it froze. Turns out OpenJDK doesn't like MIDI sequencers. So I uninstalled OpenJDK, and went through a hard time trying t oinstall the Oracle JDK. I tried:

  • PPA's (webupd8): turns out there isn't a version for jessie
  • i586, x64 JDK's: I was too stupid

Finally I arrived at the Oracle Java SE 7 JDK for ARM. Downloaded tar.gz, scp'ed to Pi, extracted with tar to /usr/lib/jvm. Used (while in root)

update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_60/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_60/bin/javac" 1
chmod a+x /usr/bin/java
chmod a+x /usr/bin/javac

and all went perfectly. Then I tried java -version and got:

java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

I checked, there is definitely a libjli.so in /usr/lib/jvm/jdk1.7.0_60/lib/arm/jli and /usr/lib/jvm/jdk1.7.0_60/jre/lib/arm/jli

Any ideas?

  • Does the user you are running your program as have the libjli,so file directory in its path? – Steve Robillard Jan 10 '16 at 14:30
  • I didn't run my program yet, I only tried java -version. What path are you talking about? Sorry, I am still learning all the linux stuff – user3099265 Jan 10 '16 at 14:33
  • who did you run java version as (pi)? – Steve Robillard Jan 10 '16 at 14:34
  • I did it in root and pi, all the same – user3099265 Jan 10 '16 at 14:35
  • if the path for the user you ran java version as does not have that file in its path it won't gind it – Steve Robillard Jan 10 '16 at 14:35
2

Got it working. Turns out some weird stuff was happening with the permissions, so I installed Java 8 and it worked fine. Thanks Steve Robillard!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.