java: not found

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
adplax18
Posts: 8
Joined: 10 Feb 2014, 21:06

java: not found

Post by adplax18 » 10 Mar 2015, 19:43

I am having a very strange issue with filebot on my synology NAS. I have a python script which I can run without issue if I kick it off via SSH logging in as root (it uses the subprocess module to call filebot), however for the scheduled job (also running as root with crontab) I receive the error message:

'/usr/local/bin/filebot: line 37 java not found'

I have tried inserting the absolute path of my java installation in line 37 and that does not work either. Any suggestions would be greatly appreciated.

adplax18
Posts: 8
Joined: 10 Feb 2014, 21:06

Re: Filebot not identifying java

Post by adplax18 » 10 Mar 2015, 20:12

As always once I posted about an issue I solved it... a symlink to java in the filebot directory seems to have solved the problem. Hope this helps someone

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot not identifying java

Post by rednoah » 11 Mar 2015, 03:36

Please read the Notes section:
viewtopic.php?f=3&t=1802

It's for Synology NAS but "installing" java correctly is probably pretty much the same for any embedded Linux.
:idea: Please read the FAQ and How to Request Help.

garyleecn
Donor
Posts: 113
Joined: 19 Nov 2014, 03:48

Re: Filebot not identifying java

Post by garyleecn » 12 May 2015, 07:54

adplax18 wrote:As always once I posted about an issue I solved it... a symlink to java in the filebot directory seems to have solved the problem. Hope this helps someone
would you please post how did you create the symlink?

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot not identifying java

Post by rednoah » 12 May 2015, 08:50

Code: Select all

ln -s /path/to/jre/bin/java /usr/local/bin/java
:idea: Please read the FAQ and How to Request Help.

garyleecn
Donor
Posts: 113
Joined: 19 Nov 2014, 03:48

Re: Filebot not identifying java

Post by garyleecn » 12 May 2015, 16:40

rednoah wrote:

Code: Select all

ln -s /path/to/jre/bin/java /usr/local/bin/java
thanks for your reply, but that's exactly what i did.


DiskStation> ln -s /path/to/jre/bin/java /usr/local/bin/java
ln: /usr/local/bin/java: File exists
DiskStation>





and still it says java not found




-----------------------------------
don't know what i did, but it comes back with another problem
Failed to initialize cache: java.nio.file.AccessDeniedException: /volume1/@appstore/filebot/data/cache/0/.lock

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot not identifying java

Post by rednoah » 13 May 2015, 06:36

1)
/path/to/jre/bin/java is NOT to be taken verbatim. It is the path to the java executable after downloading and unpacking the JDK.

For EXAMPLE:

Code: Select all

/volume1/app/jdk1.8.0_33/bin/java
2)
Uninstall FileBot. Install the latest beta version of FileBot. Always run filebot as admin, never as root.
:idea: Please read the FAQ and How to Request Help.

carver
Posts: 6
Joined: 13 Aug 2015, 19:07

Re: Filebot not identifying java

Post by carver » 13 Aug 2015, 19:30

hey guys,

i am struggling with the same problem.heres what i did so far:
(DS 415+ latest DSM)
• installing java 8
DiskStation> java -version
java version "1.8.0_51"
Java(TM) SE Embedded Runtime Environment (build 1.8.0_51-b07, headless)
Java HotSpot(TM) Embedded Server VM (build 25.51-b07, mixed mode)
• installing filebot
DiskStation> filebot -version
FileBot 4.6.1 (r3166) / Java(TM) SE Embedded Runtime Environment 1.8.0_51 (headless)
• installing filebot node

first try: /usr/bin/filebot: line 53: java: not found

tried to link the folders. here are the results who all didn't work out:
info about the location of java (i think, this shell and linux things are not my comfort zone)
DiskStation> cd /volume1/@appstore/java8/
DiskStation> dir
drwxr-xr-x 5 root root 4096 Aug 13 08:35 .
drwxrwxrwx 27 root root 4096 Aug 13 08:57 ..
drwxr-xr-x 6 root root 4096 Aug 13 08:35 ejdk1.8.0_51
-rw-r--r-- 1 root root 511 Aug 13 08:35 output.log
drwxr-xr-x 2 root root 4096 Jul 17 2014 tools
drwxr-xr-x 21 root root 4096 Nov 11 2014 zoneinfo
DiskStation> cd ejdk1.8.0_51
DiskStation> dir
drwxr-xr-x 6 root root 4096 Aug 13 08:35 .
drwxr-xr-x 5 root root 4096 Aug 13 08:35 ..
drwxr-xr-x 2 root root 4096 Jun 25 19:49 bin
drwxr-xr-x 2 root root 4096 Jun 25 19:49 doc
drwxr-xr-x 2 root root 4096 Jun 25 19:49 lib
drwxr-xr-x 7 root root 4096 Jun 25 19:49 linux_i586
DiskStation> cd linux_i586
DiskStation> dir
drwxr-xr-x 7 root root 4096 Jun 25 19:49 .
drwxr-xr-x 6 root root 4096 Aug 13 08:35 ..
drwxr-xr-x 4 root root 4096 Jun 25 19:49 compact1
drwxr-xr-x 4 root root 4096 Jun 25 19:49 compact2
drwxr-xr-x 4 root root 4096 Jun 25 19:49 compact3
drwxr-xr-x 9 root root 4096 Jun 25 19:49 extensions
drwxr-xr-x 4 root root 4096 Jun 25 19:49 jre
DiskStation> cd jre
DiskStation> dir
drwxr-xr-x 4 root root 4096 Jun 25 19:49 .
drwxr-xr-x 7 root root 4096 Jun 25 19:49 ..
-r--r--r-- 1 root root 3244 Jun 25 19:48 COPYRIGHT
-r--r--r-- 1 root root 46 Jun 25 19:48 README
-r--r--r-- 1 root root 178403 Jun 25 19:48 THIRDPARTYLICENSEREADME.txt
drwxr-xr-x 2 root root 4096 Jun 25 19:48 bin
drwxr-xr-x 12 root root 4096 Jun 25 20:42 lib
-rw-r--r-- 1 root root 524 Jun 25 19:48 release
DiskStation> cd bin
DiskStation> dir
drwxr-xr-x 2 root root 4096 Jun 25 19:48 .
drwxr-xr-x 4 root root 4096 Jun 25 19:49 ..
-rwxr-xr-x 1 root root 4100 Jun 25 19:48 java
-rwxr-xr-x 1 root root 4172 Jun 25 19:48 jjs
-rwxr-xr-x 1 root root 4184 Jun 25 19:48 keytool
-rwxr-xr-x 1 root root 4320 Jun 25 19:48 orbd
-rwxr-xr-x 1 root root 4188 Jun 25 19:48 pack200
-rwxr-xr-x 1 root root 4288 Jun 25 19:48 policytool
-rwxr-xr-x 1 root root 4172 Jun 25 19:48 rmid
-rwxr-xr-x 1 root root 4184 Jun 25 19:48 rmiregistry
-rwxr-xr-x 1 root root 4200 Jun 25 19:48 servertool
-rwxr-xr-x 1 root root 4352 Jun 25 19:48 tnameserv
-rwxr-xr-x 1 root root 202672 Jun 25 19:48 unpack200
so i tried the follwing:

Code: Select all

ln -s /volume1/@appstore/java8/ejdk1.8.0_51/bin/java /volume1/@appstore/filebot/
which led to:
DiskStation> cd /volume1/@appstore/filebot
DiskStation> dir
drwxr-xr-x 3 root root 4096 Aug 13 21:20 .
drwxrwxrwx 27 root root 4096 Aug 13 08:57 ..
-rw-r--r-- 1 root root 30956070 Aug 7 12:45 FileBot.jar
drwxrwxrwx 2 admin users 4096 Aug 12 23:58 data
-rwxr-xr-x 1 root root 1970 Aug 7 12:40 filebot.sh
lrwxrwxrwx 1 root root 46 Aug 13 21:20 java -> /volume1/@appstore/java8/ejdk1.8.0_51/bin/java
and some other things / links.... this is driving me nuts. spent some hours on this. so this is my challenge for the rest of the week. please, save my weekend :)

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot not identifying java

Post by rednoah » 13 Aug 2015, 20:06

You need to link the java executable into /usr/bin and not whatever it is you tried to do.

You need to change /path/to/jre/bin/java and you must not change /usr/local/bin/java

Code: Select all

ln -s -f /path/to/jre/bin/java /usr/local/bin/java
Here's a video tutorial:
https://www.youtube.com/watch?v=8N6hYNj_QzY
:idea: Please read the FAQ and How to Request Help.

carver
Posts: 6
Joined: 13 Aug 2015, 19:07

Re: Filebot not identifying java

Post by carver » 13 Aug 2015, 21:24

ok, i startet from scratch and followed your yt-tutorial. everything is working out until this point:
downlod ok - extract with "tar -zxvf java.tar.gz" (ds is extracting something)

next step: ls command - my result is different to the video:
DiskStation> ls
jrecreate.bat jrecreate.config.properties jrecreate.sh
and if check which version of java:
DiskStation> java
-ash: java: not found
DiskStation> java -version
-ash: java: not found
DiskStation>
thanks for your patience...

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot not identifying java

Post by rednoah » 13 Aug 2015, 21:33

Since you already have java and confirmed it's working you don't need to worry about that. Just need to symlink to /usr/bin like the example says.

Here, I replaced the path for you. Now you really just need to copy and paste...

Code: Select all

ln -s -f /volume1/@appstore/java8/ejdk1.8.0_51/bin/java /usr/local/bin/java
:idea: Please read the FAQ and How to Request Help.

carver
Posts: 6
Joined: 13 Aug 2015, 19:07

Re: java: not found

Post by carver » 14 Aug 2015, 04:38

....thx. but still a missing java.
/usr/bin/filebot: line 41: java: not found

Status quo:
DiskStation> java -version
java version "1.8.0_51"
Java(TM) SE Embedded Runtime Environment (build 1.8.0_51-b07, headless)
Java HotSpot(TM) Embedded Server VM (build 25.51-b07, mixed mode)
DiskStation> cd /usr/local/bin/
DiskStation> dir
drwxr-xr-x 2 root root 4096 Aug 14 06:33 .
drwxr-xr-x 9 root root 4096 Aug 14 06:32 ..
lrwxrwxrwx 1 root root 37 Aug 14 06:32 filebot -> /volume1/@appstore/filebot/filebot.sh
lrwxrwxrwx 1 root root 46 Aug 14 06:33 java -> /volume1/@appstore/java8/ejdk1.8.0_51/bin/java
-rwxr-xr-x 1 root root 5776 Aug 12 11:58 ldd

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java: not found

Post by rednoah » 14 Aug 2015, 07:52

Well, that doesn't make any sense! :D

Next step: Modify filebot.sh and just put in the absolute path for "java" instead of "java" and see what happens.
:idea: Please read the FAQ and How to Request Help.

carver
Posts: 6
Joined: 13 Aug 2015, 19:07

Re: java: not found

Post by carver » 14 Aug 2015, 18:37

in a weired way this is good news - i am not that incompetent :D
but, as you know by now, i am not a linux/code/ssh crack...
vi filebot.sh .... so far so good. and now, cant find the exact location where to put the java path :| (/volume1/@appstore/java8/ejdk1.8.0_51/bin/java)

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java: not found

Post by rednoah » 14 Aug 2015, 19:12

1. Go to last line
2. Replace "java" with "/volume1/@appstore/java8/ejdk1.8.0_51/bin/java"
:idea: Please read the FAQ and How to Request Help.

carver
Posts: 6
Joined: 13 Aug 2015, 19:07

Re: java: not found

Post by carver » 15 Aug 2015, 18:19

at least something, erroris a little bit different :)
/usr/bin/filebot: line 41: /volume1/@appstore/java8/ejdk1.8.0_51/bin/java: not found
fyi the content:
DiskStation> cd /volume1/@appstore/java8/ejdk1.8.0_51/bin
DiskStation> dir
drwxr-xr-x 2 root root 4096 Jun 25 19:49 .
drwxr-xr-x 6 root root 4096 Aug 14 06:34 ..
-rwxr-xr-x 1 root root 1719 Jun 25 19:49 jrecreate.bat
-rw-r--r-- 1 root root 2254 Jun 25 19:49 jrecreate.config.properties
-rwxr-xr-x 1 root root 473 Jun 25 19:49 jrecreate.sh
DiskStation>
what the hack?

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java: not found

Post by rednoah » 15 Aug 2015, 21:27

I've never seen any of these... that doesn't look like anything I'd expect in the java bin folder... there should at least be a java executable...
:idea: Please read the FAQ and How to Request Help.

carver
Posts: 6
Joined: 13 Aug 2015, 19:07

Re: java: not found

Post by carver » 16 Aug 2015, 10:21

ok, i poked around in the java8 folder and found another folder with some more files and the executable.
now it works. thanks for your help and patience. for those who maybe struggling with the same issue, the path that worked for me:

Code: Select all

/volume1/@appstore/java8/ejdk1.8.0_51/linux_i586/jre/bin/java
and for those who want to edit the filebot.sh file via mac terminal:
"vi" is the command to start the editor
"fn+i" lets you edit the lines
"esc" to finish the edit
":w" to save the changes
(this is also a personal note - in case i need it again ;) )

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java: not found

Post by rednoah » 21 Jan 2016, 11:32

My Java Installer package for Synology should take care of these issues:
https://github.com/rednoah/java-installer
:idea: Please read the FAQ and How to Request Help.

panda78
Posts: 38
Joined: 22 Jan 2016, 18:45

Re: java: not found

Post by panda78 » 02 Feb 2016, 15:58

hi ,

i have some problems to use file bot node on my syno 210j

when i install filebot node java not installing automatic and i'm trying to install with package found on package center.
unfortunatly the installation send me an error and i can use filebot node.

how can i install java8 on my syno ?


Thaks ans sorry for my english

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java: not found

Post by rednoah » 02 Feb 2016, 16:29

rednoah wrote:My Java Installer package for Synology should take care of these issues:
https://github.com/rednoah/java-installer
What have you tried? What does to log say?
:idea: Please read the FAQ and How to Request Help.

panda78
Posts: 38
Joined: 22 Jan 2016, 18:45

Re: java: not found

Post by panda78 » 03 Feb 2016, 07:26

i follow the guide on pcloadletter.co.uk but after installation ( result OK ) i have this error

filebot -script 'fn:amc' /volume1/homes/admin/Downloads/FileBot --output /volume1/homes/admin/Downloads/Video --action duplicate -non-strict --conflict auto --lang it --def 'music=y' 'unsorted=y' 'deleteAfterExtract=y' 'excludeList=.excludes' --log info --log-file '/volume1/@appstore/filebot-node/filebot.log'

------------------------------------------

/usr/local/bin/filebot: line 53: java: not found
------------------------------------------

[Process error]

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java: not found

Post by rednoah » 03 Feb 2016, 07:53

1.
What did the Java Installer log say?

2.
/usr/local/bin/java must link to the java executable. I guess the pcloadletter package doesn't set this up, so you'll need to create that link yourself via ssh.
:idea: Please read the FAQ and How to Request Help.

panda78
Posts: 38
Joined: 22 Jan 2016, 18:45

Re: java: not found

Post by panda78 » 03 Feb 2016, 08:50

rednoah wrote:1.
What did the Java Installer log say?
where can i find the logs ?

2.
/usr/local/bin/java must link to the java executable. I guess the pcloadletter package doesn't set this up, so you'll need to create that link yourself via ssh.
how can link /usr/local/bin/java to the java executable?


thanks a lot

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java: not found

Post by rednoah » 03 Feb 2016, 10:45

Read this thread again, from the beginning. You'll find your answer. ;)

@see viewtopic.php?f=13&t=2527&p=18770#p15164
:idea: Please read the FAQ and How to Request Help.

Post Reply