java.lang.ClassNotFoundException: org.apache.nifi.bootstrap.RunNiFi Error
Hi,
Anyone Unlucky enough to run into this problem (at least as it happens on version M2.0.0-M2) when you try to run run-nifi.bat file to start nifi to be welcomed with this error:
Could not find or load main class org.apache.nifi.bootstrap.RunNiFi
At this point the nifi-app.log file has not been created so you are out of luck in determining what caused this error.
Solution:
I'm not saying this is the only reason you could encounter this error. After spending some time researching this error , Idid not find the exact match of this error message but I found something close (Example: https://community.cloudera.com/t5/Support-Questions/Error-Error-Could-not-find-or-load-main-class-org-apache/td-p/141006 )
In my case you need to watch for the full error message which is :
'F:\NIFI' is not recognized as an internal or external command,
operable program or batch file.
The JAVA_HOME environment variable is not defined correctly.
Instead the PATH will be used to find the java executable.
Error: Could not find or load main class org.apache.nifi.bootstrap.RunNiFi
Caused by: java.lang.ClassNotFoundException: org.apache.nifi.bootstrap.RunNiFi
Press any key to continue . . .
Noticed the first line where it says 'F:\NIFI' is not recognized as an internal or external command..." . This is my installation path for Nifi and it turns out the full path is "NIFI 2.0.0M2" with white space between NIIF and the version and that is basically the problem. Once I removed the whitespace from the folder name it worked at least to where I can see the log file and continue from there.
Hope that will help someone out there running into the same situation.
Thanks

