Make sure your Java path exists, has a bin folder with Java.exe inside. It might help to install 64-bit Java if you have a 64-bit Operating System (and do not already have 64-bit Java).
As for the error, it does not necessarily mean that Java is the issue, because the Mod Builder uses Java in the build process. It could mean something else in the pipeline caused Java to spit out an error. If that is the case, it could be something you have done with your mod.
Also, follow this tutorial and see if it helps you build:
https://www.youtube.com/watch?v=p66hb4xGg68