Using Java 7

Adrian edited this page Jan 22, 2016 · 1 revision

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:

	at java.util.ArrayList$Itr.checkForComodification(
	at java.util.ArrayList$Itr.remove(
	at net.minecraft.launchwrapper.Launch.launch(
	at net.minecraft.launchwrapper.Launch.main(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at cpw.mods.fml.relauncher.ServerLaunchWrapper.main(

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.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.