I am running a java program from a shell script through Oozie and I get the below error
java: command not found
When I run the shell script from the edge node I do not find any issues and the java class runs without any error and I get the desired output also. However it is the oozie job that fails to run the java command.
All other actions in oozie are executed porperly but when it encounters the java
line, it throws the afore said error. I understand that all the nodes in the Hadoop cluster will have Java installed, then why do I get this error?
Below is the java command that I have in my shell script
...
...
java -cp $LOCAL_DIR/libs/integration-tools.jar com.audit.reporting.GenerateExcelReport $LOCAL_DIR/input.txt $LOCAL_DIR/
...
Please provide your thoughts.
"Issue Fixed"
I talked with my DevOps later and found that the classpath for Java was not set in few datanodes in the Cluster. This was stopping the shell action to invoke the JVM at those datanodes. After fixing the Classpath, the job ran successfully. All the comments mentioned by @Charles Duffy are valid.