LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: PeterM on August 22, 2004, 10:20:52

Title: Anyone else trying GCJ?
Post by: PeterM on August 22, 2004, 10:20:52
Hello,

After trying GCJ with some plain Java code and being impressed I thought I'd try compiling a small LWJGL app with it.

I obtained GCJ from here:

http://www.thisiscool.com/gcc_mingw.htm

I've seen a couple of threads on here that mention GCJ, the most helpful being this one:

http://puppygames.net/forums/viewtopic.php?t=549

I tried a basic one, and got hit by similar compilation errors (requiring me to recompile LWJGL without SwingAdapter and org.w3c stuff). Before continuing down this road I would like to know if anyone has successfully used GCJ in conjunction with LWJGL? I wonder if nio is still a problem?

My end goal is to have Windows and Mac versions of my code that can be run without the user installing a JRE. For me the JRE is a big roadblock for users trying Java games.

Thanks for your time,

Peter
Title: Anyone else trying GCJ?
Post by: Matzon on August 22, 2004, 13:03:57
afaik, there were (or are) some bugs in the jni code for gcj, preventing it from either compiling or running - whether this has been fixed I do not know...
Title: Anyone else trying GCJ?
Post by: PeterM on August 22, 2004, 13:30:23
You may be right there.

As far as I can tell, AndersD suspected there were JNI problems, then Bryce (a GCJ developer?) replied to him saying there were bugs in GCJ's JNI RegisterNatives. I'm not sure what that means exactly.

The last post in that thread basically says that Bryce is working on it. I'm not sure if any of the issues have been resolved yet, since the post is 2 and a half months old or so and there haven't been any updates to it.

Thanks for your reply.

Pete
Title: Anyone else trying GCJ?
Post by: tentons on August 22, 2004, 17:43:43
Are there any (even commercial) alternatives that support Mac compilation?
Title: Anyone else trying GCJ?
Post by: PeterM on August 22, 2004, 23:20:17
I'm not sure.

To me, not being able to compile for Mac isn't as big a deal as not being able to compile for Windows, because OSX comes with a recent JRE installed.
Title: Anyone else trying GCJ?
Post by: tentons on August 23, 2004, 02:01:39
According to this paper (http://www.bearcave.com/software/java/comp_java.html):

QuoteJune, 2003

Except for the Excelsior Java to native compiler, the commercial Java to native compilers are dead. Tower Technology is no longer in business. Instantiations no longer sells their Jove Java compiler and Natural Bridges is concentrating on a high performance Java interpreter. Like most compiler companies, Diab Data was purchased by another company, in this case WindRiver. I did not find any mention of the fastJ Java to native compiler on their web pages. The GNU gcj compiler, from Red Hat still exists. From talking to people who have used it, this compiler is not of the same quality as the GNU C++ compiler.

Wow.  I guess there's no hope for a native executable for Mac, and the options for other platforms are minimal.

My main deterrent for using Java is that there's such a stigma attached (a native exe would cover that), and the user might have to download the 12-15 meg JVM.  For a small commercial game, that seems like a big barrier to sales.

Didn't mean to hi-jack the thread or anything.  :)
Title: Anyone else trying GCJ?
Post by: PeterM on August 23, 2004, 11:27:08
I'm not sure the paper really reflects the state of GCJ any more, since it's over a year old.

GCJ has been used to compile the Eclipse IDE, and that's a whole lot of code. My plan is to basically just wait it out :wink: until GCJ is stable and mature enough to compile my Java games.

Judging by how progress is going on my C++ game it should give them plenty time!  :oops:

(Mental note: stop fannying around with Java and finish the game)

There are a couple of pages that I found about getting GCJ up and running with Mac:

http://users.bestweb.net/~john3g/gcj_osx/gcj_on_osx.html
http://users.bestweb.net/~john3g/gcj_osx/gcj_on_osx_gui.html

I think waiting is probably the right thing to do. GCJ does 'work', and it is being updated regularly, so it's only a matter of time before it's a viable solution.

A basic Hello World app is about 2.7MB, which is big for what it's doing, but I would think that a lot of that is fixed overhead. To me that's much better than having the user download a JRE, and hopefully it will crunch down a bit too in an installer.
Title: Anyone else trying GCJ?
Post by: tentons on August 26, 2004, 13:12:05
Thanks for the links!  :)
Title: Anyone else trying GCJ?
Post by: Orangy Tang on August 30, 2004, 23:40:18
Does anyone know where I can find a build of GCJ that'll let me compile on windows for the power pc platform? I'd try the link PeterM posted but its a little big to download over a modem so I don't know whether that'll do what I want or whether its windows only.

The other files I was looking at was http://www.mingw.org/download.shtml but I'm a little lost there. I'm assuming that a suitable collection of files there would be suitable, but it could be tricky to just start jamming files together blindly.
Title: Anyone else trying GCJ?
Post by: PeterM on August 31, 2004, 09:17:29
Quote from: "Orangy Tang"Does anyone know where I can find a build of GCJ that'll let me compile on windows for the power pc platform? I'd try the link PeterM posted but its a little big to download over a modem so I don't know whether that'll do what I want or whether its windows only.

The other files I was looking at was http://www.mingw.org/download.shtml but I'm a little lost there. I'm assuming that a suitable collection of files there would be suitable, but it could be tricky to just start jamming files together blindly.

Hello,

The link I posted (thisiscool-gcc) is for compiling for Windows on Windows. It's possible to compile a gcc cross compiler, or maybe download one from somewhere, but I've not done it so I wouldn't want to give you wrong guesses.

For Macs I'm looking more into using Jar Bundler or Project Builder to make an app bundle which behaves like a regular Mac app but is in fact a bunch of Java jars. The mac developer site isn't making it easy for me to download the tools though. (30 x 10mb segments, keeps timing out, logging me out, giving crappy download speeds, etc).

I'd like to try Xcode but I've only got OS X 10.2, not 10.3 and I'm not spending all the cash to bump up one version number!

Pete