Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

java.lang.ClassNotFoundException: org.apache.nifi.bootstrap.RunNiFi Error

avatar

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-or... )

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

 

 

2 ACCEPTED SOLUTIONS

avatar
Expert Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Super Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
3 REPLIES 3

avatar
Expert Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar

Hi @RAGHUY ,

Thanks for your reply but Im not sure you offered anything new besides what I stated in my post.  The run.bat which I dont touch or recommend anyone to touch uses relative paths and checks for system variables like %JAVA_HOME% and will return an error if its not found or set incorrectly (different kind of error). Maybe there is a way to ensure that the run.bat and the referenced file "nifi-env.bat" where the NIFI_ROOT is being set is taking care of whitesapces in the path. I tried different things  like surrounding the "NIFI_ROOT" with double quotes where referenced but it did not help.

 

 

avatar
Super Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login