Java Coding Problems

This is a new forum that can be used to discuss anything that's not directly related to JPatch.

Re: Java Coding Problems

Postby dcuny » Wed Sep 09, 2009 6:47 am

OK, I compiled and ran it. I got a window with no image on it. :?

But!

When I run the code from the terminal instead of Eclipse, it runs just fine. :mrgreen:

So there appears to be a problem with Eclipse. :roll:
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Re: Java Coding Problems

Postby sascha » Wed Sep 09, 2009 9:41 am

Intriguing!
What's in the run-configuration for the project? Does it start some alien JVM, or pass some obscure parameters over to it?
Don't use gjc+classpath for Java applications with a graphical UI! The Sun JVM and OpenJDK should both be fine though.

It's just that I never run into any such problems with Eclipse too.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Re: Java Coding Problems

Postby dcuny » Wed Sep 09, 2009 4:33 pm

The default JRE is java-1.5.0-gcj-4.3-1.5.0.0. I've installed the other JVMs, but don't know what the settings should be.

The only non-gcj library listed is JaveSE-1.6 (unbound), but I can't figure out how to configure it.

I assumed that Eclipse would use the Sun stuff by default. :(
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Re: Java Coding Problems

Postby sascha » Wed Sep 09, 2009 6:33 pm

I think the default Eclipse that you can install via a Debian package is gcj based, which isn't really optimal. You can install a Sun-JVM based Eclipse as a Debian package too, but I've always downloaded Eclipse from the eclipse.org website - this usually works out of the box.

Again, do not use GCJ+Classpath for GUI projects, I think their AWT implementation is incomplete (Eclipse works because it's based on SWT, which has always been open-source), and since OpenJDK is GPL'd now, there's really no need to use it, even if you're an open-source purist.

You can add new JDKs to Eclipse, I think you only have to point it to the base directory of the installation (that contains the rt.jar file and the bin/java executables.)
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Previous

Return to Off topic

Who is online

Users browsing this forum: No registered users and 1 guest

cron