Anyone else trying GCJ?

Started by PeterM, August 22, 2004, 10:20:52

Previous topic - Next topic

PeterM

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

Matzon

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...

PeterM

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

tentons

Are there any (even commercial) alternatives that support Mac compilation?

PeterM

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.

tentons

According to this paper:

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.  :)

PeterM

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.

tentons


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.

PeterM

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