Started by
matthew12321
on
Topic category: Troubleshooting, bugs, and solutions
So here's the error I get when I recompile my workspace, a box pops up saying that gradle failed to build the app with a Null Pointer Exception, And when I run the gradle command build I get this popup message:
I looked into the console and there is this:
Executing gradle command: build
Microsoft Windows [Version 10.0.16299.248]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Pylo\MCreator177>cd forge
C:\Pylo\MCreator177\forge>SET "JAVA_HOME=C:\Pylo\MCreator177\jdk64\"
C:\Pylo\MCreator177\forge>SET JAVA_EXE=%JAVA_HOME%\bin\java.exe
C:\Pylo\MCreator177\forge>SET PATH=%JAVA_HOME%\bin\;%PATH%
C:\Pylo\MCreator177\forge>gradlew -Dorg.gradle.jvmargs="-Xms625m -Xmx2048m" build
This mapping 'snapshot_20171003' was designed for MC 1.12! Use at your own peril.
#################################################
ForgeGradle 2.3-SNAPSHOT-c9bb579
https://github.com/MinecraftForge/ForgeGradle
#################################################
Powered by MCP unknown
http://modcoderpack.com
by: Searge, ProfMobius, Fesh0r,
R4wk, ZeuX, IngisKahn, bspkrs
#################################################
:deobfCompileDummyTask
:deobfProvidedDummyTask
:sourceApiJava UP-TO-DATE
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava
C:\Pylo\MCreator177\forge\build\sources\main\java\mod\mcreator\mcreator_VarListtestenvironmentmod.java:3: error: '{' expected
:compileJava FAILED
public class mcreator_V ^
arList%MAINMODNAME%
BUILD FAILED
C:\Pylo\MCreator177\forge\build\sources\main\java\mod\mcreator\mcreator_VarListtestenvironmentmod.java:3Total time: 40.224 secs
: error: reached end of file while parsing
public class mcreator_VarList%MAINMODNAME%
^
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
C:\Pylo\MCreator177\forge>
Task completed with return code 0 in 41664 milliseconds
From this I was able to deduce that the error was with the source file that contained MCreators global variable listing, because I don't have access to this file or even know how to properly fix it, I came here.
Edited by matthew12321 on Thu, 03/01/2018 - 01:29
I fixed the error, apparently MCreator created the class file and forgot to put the brackets the file looks like this:
When it should look like this:
Every opening braces { needs one closing braces }. The only purpose of the extra braces is to provide scope-limit . If you put curly braces in the wrong places or omit curly braces where the braces should be, your program probably won't work at all. Moreover, If you don't indent lines of code in an informative manner , your program will still work correctly, but neither you nor any other programmer will be able to figure out what you were thinking when you wrote the code. The error Reached End of File While Parsing is a compiler error and almost always means that your curly parenthesis are not ending completely or maybe there could be extra parenthesis in the end.