Using Java 7 - Gamocosm/Gamocosm GitHub Wiki

Why do I need Java 7?

Some older versions of Minecraft (I've noticed usually modded - e.g. craftbukkit or forge) are not compatible with Java 8. The errors you get with Java 8 can be cryptic; for example:

java.util.ConcurrentModificationException
	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901)
	at java.util.ArrayList$Itr.remove(ArrayList.java:865)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:114)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at cpw.mods.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:48)
	at cpw.mods.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:17)

So it's worth giving it a shot if you see something like that.

Installing Oracle Java 7

You can download Oracle Java 7 from their website (link). You can search for "oracle java 7" and get either the JRE or JDK (includes debugging/development stuff like the Java compiler). You could use the RPM download, but this guide uses the Linux x64 tar.gz file. After downloading the file to your computer, you want to copy it over to the server. There is another wiki page on FTP and SSH, but on OSX/Linux, you probably want to run scp -P <server SSH port, default 4022> <path/to/downloaded/file> mcuser@<your IP/domain>:, and on Windows you want to use FTP/an SCP client. The command above will place the download in your home folder.

Now you need to extract the file and set up your PATH environment variable. You can do this with FTP (e.g. extract file locally, upload entire folder, download, edit, and upload config files), but this guide uses SSH. After SSHing into your server, run tar -xvf <downloaded file name, e.g. jre-7u80-linux-x64.tar.gz. This will extract it in the current folder (default home folder). Then add it to your PATH by adding PATH="$HOME/extracted folder, e.g. jre1.7.0_80>/bin:$PATH to your bashrc file: echo 'PATH="$HOME/<extracted folder, e.g. jre1.7.0_80>/bin:$PATH' >> ~/.bashrc. When you relog, and run java -version, you should get Java 7.

Other distributions of Java 7

You could also download/compile/install OpenJDK 7, but this guide doesn't cover it because I don't find "nice links" for it.