Code error beyond my repair.

Started by matthew12321 on Thu, 03/01/2018 - 01:23

Topic category: Bugs and solutions

Last seen on 16:32, 1. Mar 2018
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Code error beyond my repair.
Thu, 03/01/2018 - 01:29 (edited)

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:
http://preview.ibb.co/n0zd8H/Capture.png

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
Last seen on 16:32, 1. Mar 2018
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I fixed the error,…
Thu, 03/01/2018 - 16:32

I fixed the error, apparently MCreator created the class file and forgot to put the brackets the file looks like this:
 

public class mcreator_VarList%MINMODNAME%

When it should look like this:
 

public class mcreator_VarList%MAINMODNAME%
{

}
//Or this
public class mcreator_VarList%MAINMODNAME% { }

 

Last seen on 03:52, 25. Nov 2019
Joined Nov 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Every opening braces { needs…
Fri, 11/22/2019 - 05:54

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.