Java goes GPL

Discussion in 'Game Development (Technical)' started by Bad Sector, Nov 8, 2006.

  1. Bad Sector

    Original Member

    Joined:
    May 28, 2005
    Messages:
    2,742
    Likes Received:
    5
    ...according to this article Sun will release Java ME and Java SE under GPL and Java EE under CDDL (the same license as OpenSolaris).

    This is good news for those who create Java games, because now you can legally mess with the JRE to minimize deployment sizes :). I like Java, but deploying 10MB extra is not something i like doing :p.

    I suspect that some developers may also work on creating bare-bones Java runtimes, etc (although Sun is working on a modular system for that). I for once, would like to see a configuration of LWJGL running on top of a 2-3MB JRE.

    I think that great times are coming for Java :)
     
  2. voxel

    voxel New Member

    Joined:
    Oct 29, 2006
    Messages:
    176
    Likes Received:
    0
    I've avoided Java for a while due to poor performance when I last used it (1999). Can you point me to some modern Java games that are fast and responsive? I might be a RE-convert...
     
  3. Bad Sector

    Original Member

    Joined:
    May 28, 2005
    Messages:
    2,742
    Likes Received:
    5
    1999 Java is painfully slow. I don't know if it even has basic JIT or does bytecode interpretation all the time.

    Check out Princec's games, they're all in Java. Also there was some FPS written in Java, but i don't remember the url (chrome or something like that).
     
  4. Mike

    Original Member

    Joined:
    Apr 5, 2005
    Messages:
    9
    Likes Received:
    0
    I avoid buying a car because the last time I drove a car,
    in 1907, it was so slow that a bicycle could put up with it.

    Sorry, I couldn't resist ...

    1999 ? Come on, that was SEVEN years ago !.. :rolleyes:

    Yes, Java was slow many years ago.
    But not anymore, the performance has improved very,
    very much since that.
     
  5. voxel

    voxel New Member

    Joined:
    Oct 29, 2006
    Messages:
    176
    Likes Received:
    0
    I'll take a look at it again... I started on it during the alpha/beta days in 1996. JIT didn't help performance much. The achille's heel of Java is it's bad memory management and inefficient use of memory. Even ignoring cyclic references that can't be garbage collected, Java was a memory pig. I hope it has reformed. One of the first things you write when developing memory efficient games (i.e for consoles) is a memory allocator to prevent fragmentation. Yes, memory can be fragmented like hard-drives.

    Another tech I had high hopes for was Python + pygame but pygame's software rasterizing was way too slow for commercial games. Python + OpenGL should be usable tho'...
     
  6. oNyx

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    1,212
    Likes Received:
    0
    A lot happend since 1999. Back then jit was something fresh n new and it didnt really work that well yet. 1.4.2 (mid 2003) was the first rather cool version of java. 1.5 gave the next performance boost and now there is 1.6, which again boosted performance drastically (in some extreme cases its 48% faster).

    Nowadays the garbage collection is very advanced and performance is about on par with the cheaper C++ compilers (after warmup of course). If you take the massive productivity gain into account the performance difference is negligible.

    The memory overhead is something like 8mb for the vm and something like 40 bytes per object (not that different compared to C++). The memory hog image comes from the way the VM allocates ram. At startup it allocates a big chunk (size can be overrided with switches, but if you actually need that much or more you only slow it down a bit) and allocation and deallocation of ram also happens in rather big chunks. Every managed language does that for performance reasons. Mananging the ram internally is simply way quicker and you can also prevent memory fragmentation like this.

    Cas' Titan Attacks takes for example around 80mb iirc, which isnt much of a problem... even for my very dated 6.5+ year old hardware. Oddlabs' Tribal Trouble for example also runs on that hardware.

    Together with OpenGL, OpenAL and Input wrappers (lwjgl or jogl/joal/jinput) its really a pretty neat platform.
     
  7. princec

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    4,873
    Likes Received:
    0
    Hurrah! Finally my VM will be legalised... but under GPL. I suspect that means that all my source code linking to it needs to be open source too? Where does that stand?

    Cas :)
     
  8. mot

    mot
    Indie Author

    Joined:
    Oct 21, 2004
    Messages:
    439
    Likes Received:
    0
    I was about to ask you that.
     
  9. princec

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    4,873
    Likes Received:
    0
    It's not that I mind particularly... I mean, I've given away all the source code to my games anyway... just I'm not quite sure where the line is drawn with VMs. The VM is technically not linked to the bytecode. Bytecode's just data.

    Cas :)
     
  10. GBGames

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    1,255
    Likes Received:
    0
    I doubt that Java apps will need to be similarly licensed. It is like running an application on top of a running OS. It's just data, as you say...unless you take code from the VM and incorporate it into your app.
     
  11. soniCron

    Indie Author

    Joined:
    May 4, 2005
    Messages:
    3,664
    Likes Received:
    0
    From the official GPL FAQ:
     
  12. Daire Quinlan

    Original Member

    Joined:
    Feb 22, 2005
    Messages:
    103
    Likes Received:
    0
    Yeah, I didn't know quite what to make of this when I saw it first, but its actually business as usual. The JDK/JRE and all the sun reference implementations of stuff will be dual licensed. So if you want to use Java to make commercial closed source stuff that links to the Java libs then thats ok. I sincerely doubt that sun would shoot themselves in the foot by abruptly demanding that everything linked to the java standard libs be distributed under the GPL ! Although I don't fully understand the hooha about this anyway, its not as though the Java source hasn't been fully available for years under the CDDL anyway.

    D.
     
  13. electronicStar

    Original Member

    Joined:
    Feb 28, 2005
    Messages:
    2,068
    Likes Received:
    0
    Good news.
    That might not seem very dramatic, but that means the Java language can be tweaked legally and IMHO we should see a lot of projects or engines using Java soon.
     
  14. voxel

    voxel New Member

    Joined:
    Oct 29, 2006
    Messages:
    176
    Likes Received:
    0
    Thanks for the update. I'm much prefer using interpreted languages rather than C/C++.

    Python/Java/C#/Lua are all valid choices... but my many concern these days is art toolchain and not languages. I want to leverage tools like Flash, Maya, level editors, etc.. as much as possible.

    Embedding Java is cool idea... maybe for complex AI/Networking/Web stuff...
     
  15. Bad Sector

    Original Member

    Joined:
    May 28, 2005
    Messages:
    2,742
    Likes Received:
    5
    If only the VM is GPL, then you won't be affected. If the runtime library goes GPL, however, then you are affected. But they may use LGPL with the runtime library or GPL with some exception. Both are common when dealing with open source libraries.

    I doubt they will use GPL for everything.
     
  16. cybermonk

    Original Member

    Joined:
    Aug 24, 2005
    Messages:
    40
    Likes Received:
    0
    This is good news, since I'm currently developing a game using java and lwjgl!

    Cas: how do you minimize your JRE and deploy your game with it? I suppose it's not possible to do this on my mac? Like just copying my jars into some package or directory? :)
     
  17. Daire Quinlan

    Original Member

    Joined:
    Feb 22, 2005
    Messages:
    103
    Likes Received:
    0
    nope, They're GPL'ing everything. Read my post above though, Its being released under a dual license, so only if you MODIFY the VM or the libs do you have to distribute under GPL yourself. Otherwise its the same deal as before. This is all legal and above board. GTK for example (IIRC) has the same dual GPL/Commercial license deal (with added complications actually but thats neither here nor there)

    D.
     
  18. Bad Sector

    Original Member

    Joined:
    May 28, 2005
    Messages:
    2,742
    Likes Received:
    5
    No, GTK is fully and only LGPL. Trolltech's Qt is dual licensed, GPL/Commercial but the GPL version comes with QPL (so actually it is GPL+QPL and Commercial) where QPL requires from those who perform modifications to give the copyrights back to original author (Trolltech), so they will have the right to dual license the modifications under the Commercial license.
     
  19. princec

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    4,873
    Likes Received:
    0
    No need to do anything on the Mac, just bundle your game up as per the instructions on Apple's dev site and that's it.

    On Windows I just kept deleting dlls, and classes from rt.jar, until the game still ran. Got the VM down to 2.5mb compressed, and considering its versatility (even left RMI in it!) it's a pretty good size for the runtime.

    Cas :)
     
  20. Daire Quinlan

    Original Member

    Joined:
    Feb 22, 2005
    Messages:
    103
    Likes Received:
    0
    Actually, this move by Sun could finally make your approach legal and above board (I know you've been kludging the thing with Molebox for a while now) as long as you GPL your source. Your hacked distribution would come under the auspices of a 'derivative work' I'd imagine. Given that you generally release all your sources anyway It wouldn't be too much of a jump. I presume the GPL doesn't require you to distribute the various other bits and bobs ? Images, configuration files, scripts etc etc, as long as you can -build- the original application.

    D. (IANAL)
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer