This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/master by this push:
     new 79c52ed  TIKA-2434 add headless mode to tika-batch
79c52ed is described below

commit 79c52ed71b0928cabf0cc351167da9dfe954ed0f
Author: tballison <[email protected]>
AuthorDate: Thu Aug 17 14:16:31 2017 -0400

    TIKA-2434 add headless mode to tika-batch
---
 .../main/java/org/apache/tika/cli/BatchCommandLineBuilder.java    | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/tika-app/src/main/java/org/apache/tika/cli/BatchCommandLineBuilder.java 
b/tika-app/src/main/java/org/apache/tika/cli/BatchCommandLineBuilder.java
index 2f85546..a08311e 100644
--- a/tika-app/src/main/java/org/apache/tika/cli/BatchCommandLineBuilder.java
+++ b/tika-app/src/main/java/org/apache/tika/cli/BatchCommandLineBuilder.java
@@ -75,11 +75,19 @@ class BatchCommandLineBuilder {
         //now build the full command line
         List<String> fullCommand = new ArrayList<String>();
         fullCommand.add("java");
+        boolean foundHeadlessOption = false;
         for (Map.Entry<String, String> e : jvmOpts.entrySet()) {
             fullCommand.add(e.getKey());
             if (e.getValue().length() > 0) {
                 fullCommand.add(e.getValue());
             }
+            if (e.getKey().contains("java.awt.headless")) {
+                foundHeadlessOption = true;
+            }
+        }
+        //run in headless mode unless the user asks for something else 
TIKA-2434
+        if (! foundHeadlessOption) {
+            fullCommand.add("-Djava.awt.headless=true");
         }
         fullCommand.add("org.apache.tika.batch.fs.FSBatchProcessCLI");
         //now add the process commands

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to