You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Julien Massiera (JIRA)" <ji...@apache.org> on 2018/10/12 12:32:00 UTC
[jira] [Created] (TIKA-2753) ChildProcess does not use the
JAVA_HOME
Julien Massiera created TIKA-2753:
-------------------------------------
Summary: ChildProcess does not use the JAVA_HOME
Key: TIKA-2753
URL: https://issues.apache.org/jira/browse/TIKA-2753
Project: Tika
Issue Type: Bug
Components: server
Affects Versions: 1.19.1
Reporter: Julien Massiera
If the user starting the Tika Server does not have the path to java configured in its PATH var, the following error appears in the logs :
java.io.IOException: Cannot run program "java": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at org.apache.tika.server.TikaServerWatchDog$ChildProcess.startProcess(TikaServerWatchDog.java:224)
at org.apache.tika.server.TikaServerWatchDog$ChildProcess.<init>(TikaServerWatchDog.java:149)
at org.apache.tika.server.TikaServerWatchDog$ChildProcess.<init>(TikaServerWatchDog.java:139)
at org.apache.tika.server.TikaServerWatchDog.execute(TikaServerWatchDog.java:87)
at org.apache.tika.server.TikaServerCli.execute(TikaServerCli.java:136)
at org.apache.tika.server.TikaServerCli.main(TikaServerCli.java:117)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 6 more
By checking the TikaServerWatchDog class I noticed that the startProcess method of the ChildProcess private class is using the 'java' argument. As my user only have the JAVA_HOME configured in its /etc/profile and not the path to java, this explains the error.
It would be better if the startProcess relies on the JAVA_HOME env var to use java instead of assuming that the java program is configured in the PATH env var of the user.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)