Filebot 4.6.1 + Java 1.8.0_65 + JNA 4.2.1 Raspberry Pi
Posted: 17 Nov 2015, 19:33
I'm very new to this so I though I would pass along what I did. I hope that there are not any errors but just let me know if you find them. I was going to try and create a script, but couldn't figure out the wget to download the correct Java. I tried to describe what each step does both as a learning tool and to help others.
#Install Filebot
#Get Java SE Development Kit 1.8.65 by downloading it via web browser.
#Linux ARM v6/v7 Hard Float ABI 77.69 MB jdk-8u65-linux-arm32-vfp-hflt.tar.gz
#http://www.oracle.com/technetwork/java/ ... 33151.html
#Unpack tarball to the /opt directory via the -C option
tar zxvf jdk-8u65-linux-arm32-vfp-hflt.gz -C /opt
#Installs and updates java compiler - converts text to class program
update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_65/bin/javac 1
#Installs and updates java - runs class programs
update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_65/bin/java 1
#Configures java compiler and java to use installed version
update-alternatives --config javac
update-alternatives --config java
***************************************************************
For each of these you will get the following
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java 318 auto mode
1 /opt/jdk1.8.0_65/bin/java 1 manual mode
2 /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java 318 manual mode
Press enter to keep the current choice[*], or type selection number:
Keep the current choice
***************************************************************
#Install current Filebot 4.6.1
#Create temoprary directory and go to this directory
mkdir /tmp/filebot && cd /tmp/filebot
#download ipk version of filebot.
wget http://sourceforge.net/projects/filebot ... noarch.ipk
#Use the ar command to unpack the filebot package. Debian packages always contain 3 things
#debian-binary, control.tar.gz, and data.tar.gz. -x flag tells ar to extract files.
ar -x filebot_4.6.1_arm.ipk
#Next use this to extract data tarball to directories specified with in the data.tar
tar zxvf data.tar.gz
*************************************************************
#Following are created within /tmp/filebot
#./
#./opt/
#./opt/share/
#./opt/share/filebot/
#./opt/share/filebot/bin/
#./opt/share/filebot/FileBot.jar
#./opt/share/filebot/bin/filebot.sh
**************************************************************
#Copy contents of /tmp/filebot/opt/share/* to /usr/share/
cp -r /tmp/filebot/opt/share/* /usr/share/
#Create a symbolic link from where filebot run script is to the usr binary directory so it is
#found when called to execute as /usr/bin is within the path by default.
ln -s /usr/share/filebot/bin/filebot.sh /usr/bin/filebot
##Install Java Native Access 4.2.1, Java libraries, and Mediainfo
apt-get install libjna-java mediainfo
#Create temporary directory and switch to it
mkdir /tmp/jna-4.2.1 && cd /tmp/jna-4.2.1
#Download JNA 4.2.1 and JNA-Platform 4.2.1 to temp directory
wget --no-check-certificate https://maven.java.net/content/reposito ... -4.2.1.jar
wget --no-check-certificate https://maven.java.net/content/reposito ... -4.2.1.jar
#Not sure what this is doing (maybe JMV is running the code in jna-4.2.1.jar file)
/opt/jdk1.8.0_65/bin/jar xf jna-4.2.1.jar
#Change dir
cd /usr/lib/arm-linux-gnueabihf/jni/
#Copy libjnidispatch from tmp directory to the /usr/lib/arm-linux-gnueabihf/jni/ directory
cp -p /tmp/jna-4.2.1/com/sun/jna/linux-arm/libjnidispatch.so libjnidispatch_4.2.1.so
#Rename the libjnidispatch.so in the /usr/lib/arm-linux-gnueabihf/jni to 3.2.7
mv libjnidispatch.so libjnidispatch_3.2.7.so
#Create a symlink from 4.2.1 to current.so
ln -s libjnidispatch_4.2.1.so libjnidispatch.so
#Change directory
cd /usr/share/java
#Remove jna.jar and jna-platform.jar
rm jna.jar
rm jna-platform.jar
#Copy all content from /tmp/jna-4.2.1 to /usr/share/java
cp /tmp/jna-4.2.1/*.jar .
#Create symbolic link
ln -s jna-4.2.1.jar jna.jar
ln -s jna-platform-4.2.1.jar jna-platform.jar
#Check/test jna installed version
java -jar jna.jar
Output should be
*****************
Java Native Access (JNA) API Version 4
Version: 4.2.1 (b0)
Native: 4.0.1 (1a6047467b59e8748f975e03016ce3d9)
Prefix: linux-arm
*****************
##Link mediainfo library so Filebot can use them
#Create symbolic link from where library is on pi to where filebot can find it
ln -s /usr/lib/arm-linux-gnueabihf/libmediainfo.so.0 libmediainfo.so
ln -s /usr/lib/arm-linux-gnueabihf/libzen.so.0 libzen.so
##Install 7-Zip JBinding for pi
#May already be in this directory.
cd /usr/share/filebot
wget http://hannesmueller.com/lib7-Zip-JBinding.so
##Create a new shell script to launch filebot
#Change directory to filebot library directory
cd /usr/share/filebot/bin
mv filebot.sh filebot.sh_bak
echo '#!/bin/sh' > filebot.sh
echo 'java -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dapplication.deployment=ipkg -Duser.home=/usr/share/filebot/data -Dapplication.dir=/usr/share/filebot/data -Djava.io.tmpdir=/usr/share/filebot/data/temp -Djna.library.path=/usr/share/filebot -Djava.library.path=/usr/share/filebot -Dnet.filebot.AcoustID.fpcalc=/usr/share/filebot/fpcalc -jar /usr/share/filebot/FileBot.jar "$@"' >> filebot.sh
#Give shell permission to run script
chmod +x filebot.sh && chmod 777 filebot.sh
#Check File bot works
sudo filebot -script "fn:sysinfo"
Output should be
************************
FileBot 4.6.1 (r3315)
JNA Native: 4.0.1
MediaInfo: MediaInfoLib - v0.7.70
7-Zip-JBinding: java.lang.UnsatisfiedLinkError: net.sf.sevenzipjbinding.SevenZip.nativeGetVersionMajor()I
Nov 17, 2015 5:45:29 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created usr preferences directory.
Chromaprint: java.io.IOException: Cannot run program "/usr/share/filebot/fpcalc": error=2, No such file or directory
Extended Attributes: OK
Groovy Engine: 2.4.5
JRE: Java(TM) SE Runtime Environment 1.8.0
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 224 MB Max Memory / 13 MB Used Memory
OS: Linux (arm)
Package: IPKG
Data: /usr/share/filebot/data
uname: Linux raspberrypi 4.1.7-v7+ #817 SMP PREEMPT Sat Sep 19 15:32:00 BST 2015 armv7l GNU/Linux
Done ヾ(@⌒ー⌒@)ノ
************************
It looks like fpcalc won't work. I'll have to figure that out.
#Install Filebot
#Get Java SE Development Kit 1.8.65 by downloading it via web browser.
#Linux ARM v6/v7 Hard Float ABI 77.69 MB jdk-8u65-linux-arm32-vfp-hflt.tar.gz
#http://www.oracle.com/technetwork/java/ ... 33151.html
#Unpack tarball to the /opt directory via the -C option
tar zxvf jdk-8u65-linux-arm32-vfp-hflt.gz -C /opt
#Installs and updates java compiler - converts text to class program
update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_65/bin/javac 1
#Installs and updates java - runs class programs
update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_65/bin/java 1
#Configures java compiler and java to use installed version
update-alternatives --config javac
update-alternatives --config java
***************************************************************
For each of these you will get the following
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java 318 auto mode
1 /opt/jdk1.8.0_65/bin/java 1 manual mode
2 /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java 318 manual mode
Press enter to keep the current choice[*], or type selection number:
Keep the current choice
***************************************************************
#Install current Filebot 4.6.1
#Create temoprary directory and go to this directory
mkdir /tmp/filebot && cd /tmp/filebot
#download ipk version of filebot.
wget http://sourceforge.net/projects/filebot ... noarch.ipk
#Use the ar command to unpack the filebot package. Debian packages always contain 3 things
#debian-binary, control.tar.gz, and data.tar.gz. -x flag tells ar to extract files.
ar -x filebot_4.6.1_arm.ipk
#Next use this to extract data tarball to directories specified with in the data.tar
tar zxvf data.tar.gz
*************************************************************
#Following are created within /tmp/filebot
#./
#./opt/
#./opt/share/
#./opt/share/filebot/
#./opt/share/filebot/bin/
#./opt/share/filebot/FileBot.jar
#./opt/share/filebot/bin/filebot.sh
**************************************************************
#Copy contents of /tmp/filebot/opt/share/* to /usr/share/
cp -r /tmp/filebot/opt/share/* /usr/share/
#Create a symbolic link from where filebot run script is to the usr binary directory so it is
#found when called to execute as /usr/bin is within the path by default.
ln -s /usr/share/filebot/bin/filebot.sh /usr/bin/filebot
##Install Java Native Access 4.2.1, Java libraries, and Mediainfo
apt-get install libjna-java mediainfo
#Create temporary directory and switch to it
mkdir /tmp/jna-4.2.1 && cd /tmp/jna-4.2.1
#Download JNA 4.2.1 and JNA-Platform 4.2.1 to temp directory
wget --no-check-certificate https://maven.java.net/content/reposito ... -4.2.1.jar
wget --no-check-certificate https://maven.java.net/content/reposito ... -4.2.1.jar
#Not sure what this is doing (maybe JMV is running the code in jna-4.2.1.jar file)
/opt/jdk1.8.0_65/bin/jar xf jna-4.2.1.jar
#Change dir
cd /usr/lib/arm-linux-gnueabihf/jni/
#Copy libjnidispatch from tmp directory to the /usr/lib/arm-linux-gnueabihf/jni/ directory
cp -p /tmp/jna-4.2.1/com/sun/jna/linux-arm/libjnidispatch.so libjnidispatch_4.2.1.so
#Rename the libjnidispatch.so in the /usr/lib/arm-linux-gnueabihf/jni to 3.2.7
mv libjnidispatch.so libjnidispatch_3.2.7.so
#Create a symlink from 4.2.1 to current.so
ln -s libjnidispatch_4.2.1.so libjnidispatch.so
#Change directory
cd /usr/share/java
#Remove jna.jar and jna-platform.jar
rm jna.jar
rm jna-platform.jar
#Copy all content from /tmp/jna-4.2.1 to /usr/share/java
cp /tmp/jna-4.2.1/*.jar .
#Create symbolic link
ln -s jna-4.2.1.jar jna.jar
ln -s jna-platform-4.2.1.jar jna-platform.jar
#Check/test jna installed version
java -jar jna.jar
Output should be
*****************
Java Native Access (JNA) API Version 4
Version: 4.2.1 (b0)
Native: 4.0.1 (1a6047467b59e8748f975e03016ce3d9)
Prefix: linux-arm
*****************
##Link mediainfo library so Filebot can use them
#Create symbolic link from where library is on pi to where filebot can find it
ln -s /usr/lib/arm-linux-gnueabihf/libmediainfo.so.0 libmediainfo.so
ln -s /usr/lib/arm-linux-gnueabihf/libzen.so.0 libzen.so
##Install 7-Zip JBinding for pi
#May already be in this directory.
cd /usr/share/filebot
wget http://hannesmueller.com/lib7-Zip-JBinding.so
##Create a new shell script to launch filebot
#Change directory to filebot library directory
cd /usr/share/filebot/bin
mv filebot.sh filebot.sh_bak
echo '#!/bin/sh' > filebot.sh
echo 'java -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dapplication.deployment=ipkg -Duser.home=/usr/share/filebot/data -Dapplication.dir=/usr/share/filebot/data -Djava.io.tmpdir=/usr/share/filebot/data/temp -Djna.library.path=/usr/share/filebot -Djava.library.path=/usr/share/filebot -Dnet.filebot.AcoustID.fpcalc=/usr/share/filebot/fpcalc -jar /usr/share/filebot/FileBot.jar "$@"' >> filebot.sh
#Give shell permission to run script
chmod +x filebot.sh && chmod 777 filebot.sh
#Check File bot works
sudo filebot -script "fn:sysinfo"
Output should be
************************
FileBot 4.6.1 (r3315)
JNA Native: 4.0.1
MediaInfo: MediaInfoLib - v0.7.70
7-Zip-JBinding: java.lang.UnsatisfiedLinkError: net.sf.sevenzipjbinding.SevenZip.nativeGetVersionMajor()I
Nov 17, 2015 5:45:29 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created usr preferences directory.
Chromaprint: java.io.IOException: Cannot run program "/usr/share/filebot/fpcalc": error=2, No such file or directory
Extended Attributes: OK
Groovy Engine: 2.4.5
JRE: Java(TM) SE Runtime Environment 1.8.0
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 224 MB Max Memory / 13 MB Used Memory
OS: Linux (arm)
Package: IPKG
Data: /usr/share/filebot/data
uname: Linux raspberrypi 4.1.7-v7+ #817 SMP PREEMPT Sat Sep 19 15:32:00 BST 2015 armv7l GNU/Linux
Done ヾ(@⌒ー⌒@)ノ
************************
It looks like fpcalc won't work. I'll have to figure that out.