java.io.IOException: Cannot run program "env": CreateProcess error=2, The system cannot find the file specified

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

You might be using the wrong way to add commands to the command line. Try using commandDownloader.add("command");

tip

If you're trying to make a splash screen, check this tutorial: https://goo.gl/zQyCYe

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • While trying to run EXIFTool Parser using Tika on Windows OS, we are getting following error output. (Ref: http://wiki.apache.org/tika/EXIFToolParser) java.io.IOException: Cannot run program "env": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at org.apache.tika.parser.external.ExternalParser.parse(ExternalParser.java:182) at org.apache.tika.parser.external.ExternalParser.parse(ExternalParser.java:145) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) at org.apache.tika.parser.ParserDecorator.parse(ParserDecorator.java:177) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120) at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:190) at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:491) at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:144) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 13 more Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.external.ExternalParser@51efea79 at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:282) at org.apache.tika.parser.ParserDecorator.parse(ParserDecorator.java:177) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120) at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:190) at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:491) at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:144) Caused by: java.lang.NullPointerException at org.apache.tika.parser.external.ExternalParser.parse(ExternalParser.java:218) at org.apache.tika.parser.external.ExternalParser.parse(ExternalParser.java:145) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) ... 7 more After analyzing the stack trace and little experimentation, we found that "env" is unix/Mac OS X/Linux specific command and does not work on Windows. We were able to workaround this problem by adding some Windows specific code, recompile Tika and run again with similar setup. I am attaching the original file and modified file for review. If fix is acceptable by Tika specific standards, I can send the pull request on Github to contribute the patch.
    via by Nilay Chheda,
  • R Pluging Error
    via GitHub by sirinath
    ,
  • Java Bytes: Jasper Reports - Example
    via by Unknown author,
  • DynamicReports • View topic - Simple Report
    via by Unknown author,
  • APK Tool Build Error
    via Stack Overflow by Risal Fajar Amiyardi
    ,
    • java.io.IOException: Cannot run program "env": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at org.apache.tika.parser.external.ExternalParser.parse(ExternalParser.java:182) at org.apache.tika.parser.external.ExternalParser.parse(ExternalParser.java:145) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) at org.apache.tika.parser.ParserDecorator.parse(ParserDecorator.java:177) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120) at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:190) at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:491) at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:144) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 13 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    140 more bugmates