Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.6.0
-
None
-
None
Description
Hello,
I am a first time FLUME user and I was immediately tripped up, out of the gate, trying to setup the simple tutorial test environment.
F:\hadoop\flume\apache-flume-1.6.0\bin>set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_45\jre" F:\hadoop\flume\apache-flume-1.6.0\bin>flume-ng.cmd agent -conf f:/hadoop/flume/apache-flume-1.6.0/conf --conf-file ../conf/flume-conf.properties.template --name agent F:\hadoop\flume\apache-flume-1.6.0\bin>powershell.exe -NoProfile -InputFormat none -ExecutionPolicy unrestricted -File F:\hadoop\flume\apache-flume-1.6.0\bin\flume-ng.ps1 agent -conf f:/hadoop/flume/apache-flume-1.6.0/conf --conf-file ../conf/flume-conf.properties.template --name agent Sourcing environment configuration script f:/hadoop/flume/apache-flume-1.6.0/conf\flume-env.ps1 WARN: HADOOP_PREFIX or HADOOP_HOME not found WARN: HADOOP_PREFIX not set. Unable to include Hadoop's classpath & java.library.path WARN: HBASE_HOME not found WARN: HIVE_HOME not found Running FLUME agent : class: org.apache.flume.node.Application arguments: -n agent -f "F:\hadoop\flume\apache-flume-1.6.0\conf\flume-conf.properties.template" Start-Process : This command cannot be executed due to the error: The parameter is incorrect. At F:\hadoop\flume\apache-flume-1.6.0\bin\flume-ng.ps1:189 char:23 + $x = Start-Process <<<< $javaPath -ArgumentList "$fullJavaCommand" -Wait -NoNewWindow + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand F:\hadoop\flume\apache-flume-1.6.0\bin>
Did you catch the problem there? No? Neither did I at first. The error message is pretty cryptic and I thought it was complaining about the "StartProcess" command specifically.
The problem is that I included double-quotes around my JAVA_HOME path value. The double-quotes are erroneously inserted literally onto the command line and the Java executable file path stored in "$javaPath" understandably cannot be found on the local file system. I was finally able to diagnose with a dry-run where I could visually inspect the javaPath variable.
Can you please add JAVA_HOME to list of environment variables presented onto the screen at startup?
Can you please add a "file exists and is executable" check in the batch script? If the java executable cannot be found, simply print a nice error messages stating the problem and the value of "$javaPath"
Thanks!