Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Is Java viable for serious game development?

I have been learning Java for a few months now, and there were a few things I was thinking about based on what I know about Java and games written in it. Is it viable to use it for making video games?

Some things that affected what I was thinking:

  1. Java is a very secure language so it might be a good choice for multiplayer games where hacking is an issue
  2. It is designed for web portability
  3. The way it functions can make it very slow, which is bad for any realtime games
  4. This is just something I have noticed, not necessarily linked to Java: if left running for too long it can start to become unstable(?)
  5. On the other hand, I noticed that games such as Minecraft uses Java, and those do not seem as affected by those problems.
  6. The immutability of several data types: I know it's a security feature, but not being able to re-size an array can get frustrating.
  7. This may just a matter of style, but I got into a discussion with my CS teacher about whether or not you should use in-place computing. I mentioned that if you are doing something frame by frame, then it would be better. He agreed, but he also said that in most applications you'd want to retain the original value.

So based on these and other possible concerns/benefits, is Java viable?

share|improve this question

marked as duplicate by bummzack, Byte56, Sean Middleditch, Kylotan, Trevor Powell Dec 28 '12 at 18:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 5 down vote accepted

I have spent a lot of time toying with Java making hobby games. I have only recently converted to C/C++. My answer to your question would be ABSOLUTELY, to an extent.

Java provides some great libraries that can make developing games quite simple: LWJGL, Slick2D and, libGDX are 3 prime examples. Java's simplicity is a godsend when debugging(let's be blunt, C is a total pain sometimes).

However, where Java falls short, is performance. In the 2D field, there isn't much leeway - 2D games aren't usually render/GPU intensive. But when it comes to 3D: LWJGL simply cannot compare to C/OpenGL.

It all depends on how big of a project you are aiming for. If you want to make a 2D game, by all means go with Java. But I think it's safe to say that if you are aiming for 3D graphics with an emphasis on visuals, go with C/C++.

share|improve this answer

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