Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Is there any specific reason why Java was the right choice for Minecraft?

share|improve this question
Discussed on minecraft forums and very likely not fit for this site. minecraftforum.net/topic/… –  sm4 Jun 6 '13 at 7:46
They just chose to use Java, probably because they were more familiar with it than for example C++. It most likely would run a lot better if it was coded in (proper) C++ –  Jaakko Lipsanen Jun 6 '13 at 7:48
@JaakkoLipsanen And that's the point where discussion starts... –  sm4 Jun 6 '13 at 7:55
Obviously it's because Mojang spend years learning every single programming language in existence, weighting their syntax, semantics and available solutions, libraries and frameworks. And after all of this he decided that Java was a best language for Minecraft… –  nirth Jun 6 '13 at 9:30
Why does it matter anyway? –  Maik Semder Jun 6 '13 at 10:25
show 3 more comments

closed as not constructive by Sean Middleditch, Maik Semder, Byte56, Anko, John McDonald Jun 6 '13 at 14:46

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

up vote 6 down vote accepted

I saw a video from GDC where he said that he used Java because it's what he felt most productive in, at least at the time. It was only a passing comment though and note that this video is post-Minecraft, so his reasoning may not have been the same when he started Minecraft.

Source: This video from about 14:45 in answer to the question "What Tools or Technology Would You Recommend?"

share|improve this answer
add comment

A lot of people hate on Java, but honestly, modern Java is quite good. I mean, sure javac will never be as fast as a C/C++ compiler but if you take an in-depth look on how your Java code gets compiled into what eventually gets read by the JVM, you'll see why it's "slower."

Regardless, Java is a powerful and straight-forward language and I could speculate that he chose it both for the fact that he was comfortable with it and that he recognized that Java has platform-independence. That is, you can write your code (excluding native libraries you may be using) and compile it on that machine and it should be able to run on machines with different architecture, so long as they have the required JDK/JRE installed. And the way that Java handles networking-related tasks makes online(ish) games significantly easier to deal with. It also doesn't require you to explicitly handle all of your memory all of the time, something I find nice. Obviously, some people dislike that and, in all honesty, handling your memory 100% on your own is the "correct" way of doing it, but who does things the correct way these days? We have fast computers, let the garbage collector clean up our mess so we can focus on making fun games instead of the best way to handle dereferenced variables.

Here's some more thoughts, I like the second comment quoting John Carmack: http://stackoverflow.com/questions/1034458/why-arent-video-games-written-in-java

share|improve this answer
Sometimes java can really be faster than c++ because the JIT knows exactly what system its running on and can optimise for just that system whereas a C compiler must target a subset of systems –  Richard Tingle Jun 21 '13 at 11:07
add comment

That is a question for the "What If Machine" from Futurama unless they officialy say it somewhere you can never tell. From what I would say it might have been chosen due to the fact that Java is cross platform and it is very easy to install it on Windows, Mac or Linux.

The second reason; the reason I would choose, is the fact that he must have had previous experience with Java. He said that he had worked for king.com. Here is the possible explenation. So from what I understand, he simply dislikes C++.



My name is Markus Persson, and I'm a programmer. You can call me "Notch". If you want to, you can email me at notch@mojang.com. Be warned that my spam filter eats far too many real emails, though. What I Do

I currently run my own company called Mojang Specifications, where I'm currently developing a game called Minecraft.

I used to work for Jalbum as a programmer. Or developer. Or code guru. We got to pick our own titles. :D

> Before that, I worked for King.com as a game programmer for 4.5 years. I wrote games like Funny Farm, Luxor, and Carnival Shootout. I mostly did actionscript programming there, but also some java for the game verification code. Recently, I've done some work in C++. It's a powerful language and fun, but the retarded compilation system makes me cry a bit.

I was one of the founders of a unique mmorpg called Wurm Online. I'm no longer active there. I also make music under the name Markus Alexei. It's electronica, and releases are very far apart.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.