PDA

View Full Version : Java "Consumer JRE"


Bad Sector
05-24-2007, 05:12 PM
The story (http://java.sun.com/developer/technicalArticles/javase/consumerjre/).

In a few words, seems that Sun took notice that today Java isn't very consumer friendly, especially in the applet and downloadable programs front and they're trying to fix these issues. Particularly interesting are the Java Kernel feature which will contain only a very basic JRE and download the rest on demand (they managed to run Limewire with a 4mb JRE) and the Quickstarter feature which will, well, start the runtime faster by caching some stuff at startup time (they say they won't load a JRE at startup time though, so i'm not sure how else they will fix this - but then, if there is only a smally 4mb JRE, load time will be vastly reduced). For windows developers the use of Direct3D for simple 2D applications seems a nice addition too.

Personally i also liked the new UI for Swing. It was just about time to get rid of that ugly metal theme. Still, the new "Nimbus" look doesn't look 100% right, but it's far far better than the monstrosity that metal is :-P.

princec
05-25-2007, 05:28 AM
A while to wait for it though, even so.

Cas :)

electronicStar
05-25-2007, 08:46 AM
The dragon is awaken after a thousand years, but isn't it too late?

princec
05-25-2007, 08:57 AM
Too late for what?

Cas :)

electronicStar
05-25-2007, 09:17 AM
To become popular:p

princec
05-25-2007, 09:40 AM
Meh, it's already popular in ordinary dev circles. It'll trickle down to game dev eventually.

Cas :)

oNyx
05-25-2007, 03:05 PM
It's actually very popular:
http://www.tiobe.com/tpci.htm
http://www.cs.berkeley.edu/~flab/languages.html

For game development it isn't that popular yet, but the consumer JRE could help there a bit.

wazoo
05-25-2007, 04:22 PM
I'm enjoying LWJGL at the moment, but I wish Sun shake things up:

1. Drop Java3D. Does anybody use it outside of universities?

2. Create a "Games Dev Portal" site similar to the DirectX area on the MSDN. Have friendly links with information about LWJGL and JOGL all of which have been used in commercial games!!! They sort of have something now...but. meh.

I realize they probably don't want to get into the business of picking and choosing 3rd party java libraries (such as LWJGL and JOGL) but c'mon...if their current approach isn't working, why not shake things up a bit?

3. If you already like Java, then you're more than likely going to stick with it. However that tends to promote a bit of "tunnel vision". Maybe Sun should create a Game Liason type of position just to gather data from game/entertainment companies on *why* they're not using Java. Is it just because of the bundled runtime issue? Or is there more there...?

I don't know...I definitely don't have all the answers on the best of days, but given how portable java is across the PC / Mac / Linux platform, and contrast that with the adoption by game companies, I'm just hoping for more than what they currently have...

If they stand still for too long, XNA will cream them IMHO.

/shrug

Bad Sector
05-25-2007, 06:09 PM
Comparing XNA and Java is like comparing -guess!- apples and oranges (how original... but yeah it's just like that).

XNA is a framework built on .NET.
Java is a language, a runtime environment and a library of classes.

It's more appropriate to compare XNA and LWJGL, but even in this case, i think that LWJGL is a more low-level library than XNA.

If XNA-for-mobile-devices existed, it *could* be comparable with J2ME plus some of JSPs that had to do with model skinning stuff, etc.


Also, why drop Java3D? Some people use it you know...

wazoo
05-25-2007, 09:22 PM
Agreed Bad Sector.

They are apples and oranges, but they both have a feel of "next generation" in terms of game development (at least that's how I look at them).

But I'm not trying to start a flame war about languages (my apologies if that's how it's interpreted).

I just meant that if Sun is serious about gaming, then maybe they should start throwing some resources into a proper community around it, other than some forums....

I mean how about some interviews with today's entertainment companies that successfully use Java? What were their challenges? What were their successes? While there are a lot of great gaming libraries other than LWJGL and JOGL, at least start highlighting what those are and what they give you...?

I don't know...like I say, I don't have the answers :(

And about Java3D, I just meant that even Sun doesn't really make it out to be "commercial grade"...more like an experiment in 3D scene management. /shrug.

Maybe put together a game console prototype built on a stripped down java runtime with some OpenGL-capable hardware?

ah well...

princec
05-26-2007, 09:16 AM
Maybe put together a game console prototype built on a stripped down java runtime with some OpenGL-capable hardware?

It's called a Mac Mini :D

Apparently the Gaming Technology Group have just been recognised finally as being on to something big and the top brass have started to put money into the client side of development (as opposed to their previous focus which was serverside) but you only have to take one look at what MS are doing with XNA, XBLA, .net and Vista, etc. to realise just how far behind they are in this. Largely I think because no-one truly competent is in charge of it all at board level. Sun need to hire some new blood in to help out.

Cas :)

wazoo
05-26-2007, 10:03 AM
but you only have to take one look at what MS are doing with XNA, XBLA, .net and Vista, etc. to realise just how far behind they are in this. Largely I think because no-one truly competent is in charge of it all at board level. Sun need to hire some new blood in to help out.

Cas :)

QFT

Well hopefully they'll start to get their act together. They could always pull a google by luring away some unappreciated higher level DirectX/XNA manager or two...

electronicStar
05-26-2007, 03:24 PM
It's called a Mac Mini :D

Apparently the Gaming Technology Group have just been recognised finally as being on to something big and the top brass have started to put money into the client side of development (as opposed to their previous focus which was serverside) but you only have to take one look at what MS are doing with XNA, XBLA, .net and Vista, etc. to realise just how far behind they are in this. Largely I think because no-one truly competent is in charge of it all at board level. Sun need to hire some new blood in to help out.

Cas :)
Lol you are probably the more qualified person to help them right now, you and Evanstaul who did Rage of magic. You know the market and what devs need.
Oh and I remember the conversations on JGO when everybody was thinking the Playstation 3 would run on Java :D

tau
05-26-2007, 06:02 PM
Agree, there is good future for Java as the gaming platform. It works fine on cell phones, it can work fine on PCs or game consoles.

Guys, I always wanted to start 3D game development on Java. Can you round up please the existing 3D libs and their cons and pros from your experience?

Bad Sector
05-27-2007, 12:06 AM
Just noticed this blog entry on Java Kernel (http://weblogs.java.net/blog/enicholas/archive/2007/05/java_kernel_unm.html) where the author of JK says that

The Kernel JRE's installer includes jvm.dll, the other native files and hundreds of classes needed to boot the JVM, the Java Plug-In, Java Web Start, java.exe, javaw.exe, javaws.exe, the installation code, and various support libraries needed to support the installer (such as unpack200).

And it's only 1.9MB.

If you build a custom bundle containing the classes required to run a typical Swing program, it comes out to about 1.5MB, for a total download of around 3.4MB for the JRE + custom bundle. Bigger programs might use as much as 4MB-5MB of the total JRE size, but it would be rare to exceed that.

oNyx
05-27-2007, 04:25 AM
With a custom stripped JRE the default opengl gears demo (lwjgl) is about 1.5mb as installer (lzma+p200 compression). A very minimalistic game with a few sound effects, one or two tracker modules, gamepad support and a handfull of tiny textures fits nicely into about 2.5mb. If you try hard enough. ;)

With 5mb as target you have quite a lot of room. Any extra code gets compressed to basically nothing:
http://kaioa.com/svg/compression_ratio.svgz (looks better with Opera)

With this setup you get something like "jar.pack.lzma" or "jar.pack.lzma (no debug)". Even if you throw 10mb* of classes into the installer, it will merely grow by about 1mb. Or more... depending on how much more of the standard lib you're pulling in.

[* For those who aren't familiar with Java... thats a totally insane amount of classes. It's enough for writing Tribal Trouble - twice.]

So, these figures aren't really that surprising. The consumer JRE is more then welcome, however, since stripping a JRE is a major PITA. Well, the effort is sort of acceptable if you use some kind of bare bone and add RT stuff on a by package level. Or if you settle with a specific subset of packages like util, io, net, nio and xml.

elias
05-27-2007, 11:41 AM
The consumer JRE is more then welcome, however, since stripping a JRE is a major PITA.

Not to mention a breach of the standard JRE license. You could probably do a manual stripped JRE off the now open sourced openjdk, but that's not the stable java 6 (and openjdk still contains a few closed source components).

- elias

princec
05-28-2007, 04:52 AM
Shhh, they're turning a blind eye to it for now ;) Remember Molebox (http://www.molebox.com) keeps prying eyes out of dirty secrets...

Cas :)

wazoo
05-29-2007, 08:10 PM
Shhh, they're turning a blind eye to it for now ;) Remember Molebox (http://www.molebox.com) keeps prying eyes out of dirty secrets...

Cas :)

Is it just me or is the very idea of Sun going after the guys trying like hell to get Java recognized/deployed as mainstream "enough" for casual games, akin to the record companies suing the very customers that buy their products? :p

oNyx
05-29-2007, 08:53 PM
Well, they certainly won't sue anyone for that. Fortunately Sun isn't retarded. For one they aren't losing anything. If they would win it wouldn't even yield enough money to cover the coffee costs of one month. And PR wise it would be a pile of poop. Totally not worth it.

Heck. They even demonstrate how little they care by promoting such oh-so-evil software. ;)

princec
05-30-2007, 04:44 AM
Exactly. Sun have made quite a song and dance about my little games and never once has anyone moaned about my deployment "techniques". And now finally they're actually addressing the issue I have by producing a mini-VM. Sweet.

Cas :)

TJM
05-30-2007, 06:29 AM
I mean how about some interviews with today's entertainment companies that successfully use Java?

Do any companies who develop commercial games use Java? If so, who?

Also, since Java is cross-platform, powerful, and easy to use, why isn't it popular?

princec
05-30-2007, 06:49 AM
Several companies do... theres mine, Oddlabs, the Runescape guys, the people who did IL-Sturmovic, the ones that did Vampyre Masquerade (I think).

It's not popular because a) it doesn't run on any consoles which sort of negates its popularity in games dev business right now as two thirds of the money is in the console market and b) a continuing reluctance for prima donna games engineers to accept their own failings and understand that someone else has solved their problems to a large extent

Cas :)

cliffski
05-30-2007, 07:34 AM
Do you need me to explain pointers to you again cas? :D

princec
05-30-2007, 09:21 AM
Smartypants :)
But you're a prime candidate for using Java, given the GUI-intensive nature of your games, and total lack of ability to port them to the Mac ;)

Cas :)

jankoM
05-30-2007, 10:06 AM
yeah cliffky... I am making a bussines app in java and with $100 and a very nice skin my gui elements looked way better (in 5 minuts) than gui in your games :) (now I will hide in a hole and throw away the shovel)

//and I don't think statically better (like better bitmaps) but they animate, shade in real time glow reflect and all that desk2.0 stuff

Jesse Aldridge
05-30-2007, 11:01 AM
Indeed.
And Java people don't have to deal with shit like this:
http://forums.indiegamer.com/showthread.php?t=10408

wazoo
05-30-2007, 01:54 PM
Indeed.
And Java people don't have to deal with shit like this:
http://forums.indiegamer.com/showthread.php?t=10408

yeah just shit like this :)

http://forums.indiegamer.com/showthread.php?t=9481&highlight=java+bug

Anyways, all kidding aside, whenever I have had the time to work on my game, it's using the LWJGL library which I couldn't be more happy with..

princec
05-30-2007, 02:10 PM
I believe the resolution to that particular issue was in fact driver-related... :)

Cas :)

oNyx
05-30-2007, 02:52 PM
Now that I read that thread again... it could be the hdd starting to spin. With win2k I get a complete 5 second freeze whenever that happens (you can't even move the mouse pointer etc). Usually that's pretty audible tho.

Well, there are certainly a lot less mistakes to make with a managed language. And those mistakes, you can still do, are easy to track down. Unless it's a flow glitch, but then again... no language can protect you from those.

20thCenturyBoy
06-01-2007, 07:19 AM
The way I see it, this "consumer JRE" possibly gets rid of one of the three main bugbears of Java, the other two being the huge memory footprint and slow startup time. Even the smallest Java game I play seems to use about 80MB of RAM. Now, in these days of 2GB RAM for $80 maybe that will become less of an issue. The slow startup time is a real problem. I dunno how that can be solved.
Oh yeah, there is another bugbear - the fact that each Java app kicks off a new VM. Is that being worked on?

Regardless, I still find developing in Java a pleasure, mainly because the IDEs are a magnitude more effective than Visual Studio.

clilian
06-01-2007, 09:55 AM
Hi,

Slow startup time is twofold :
- cold startup : this one is really slow
- warm startup (java at least launched once since last computer reboot) : this one is usually bearable (takes at most a few seconds, generally less than one on a recent computer)

Cold startup is addressed (well it seems so) by consumer JRE by putting main java files in the disk cache. According to Sun's blogs, this could help a lot cold startup and put it on par with warm startup.

Lilian :)

tau
06-01-2007, 11:54 AM
Well, even JRE cold start is not that bad as the .NET cold start... It takes more time to launch VS 2005 then Netbeans or Eclipse :)

I benchmarked the cold startups and these are results (top is the fastest):
1. Mono
2. JRE 1.5
3. .NET 2.0

It's not that bad to wait 3 seconds for a java application to startup, the main issue, I believe is the redistributable size of JRE, especially for games (you never know if the user has the correct jre version on his/her computer).

oNyx
06-01-2007, 07:33 PM
Startup time was also addressed with 1.6. Well, the subjective side of things.

There is a -splash switch now, which allows you to show some kind of image. They used a native lib for that, which means that it can be shown quicker... way before the VM is actually loaded.

Of course your program doesn't start any faster, but it feels a lot more responsive thanks to that little trick.

Once the VM is actually up and running you can start drawing over that splash screen, showing some loading progress or whatever. There is of course some drawback: it pulls AWT dependencies in. But maybe it will be sorted out by someone, now that Java is opensource.

impossible
06-01-2007, 08:56 PM
If Sun was smart (or just thought like I did) they would position Processing as an XNA competitor and get in league with Nintendo (or Sony, or both) to get a good JVM running on the Wii and\or PS3... It would at least make me really happy :).