0
votes

In MCP (Minecraft Coder Pack) when I run recompile.bat I get the following error:

"(use -source 7 or higher to enable strings in switch)"

I want to set so that MCP uses Java 8 when I recompile, but where am I going to put that "-source 8", which file in MCP and where?

3

3 Answers

0
votes

Since it is a bat file I am going to assume this is batch so it can execute regular windows commands. You need to look for the line which gives the compile command, which is for java: javac. Here is a list of commands you could add, including the -source flag: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html

0
votes

In order to resolve this issue, you need to find your gradle.build file.

Include the following lines in that file somewhere near the version= line:

targetCompatibility=7 
sourceCompatibility=7

This will allow you to use the Java 7+ switch on String variables. (It will trigger the use of -source 7 on the java compile command lines.) I'll leave it for you to see if you "8" works as well.

0
votes

In your MCP directory there should be a folder called "conf". In it you have to open the "mcp.cfg" file and search for a line begining with "CmdRecomp". Here you can edit the source version.