PDA

View Full Version : Problems with Eclipse in FC5



mbratch
21st May 2006, 07:53 PM
I used Eclipse successfully in RedHat Version 9, which was my prior Linux installation. I did a complete fresh installation of FC5 on my computer to get the latest stuff.

Eclipse will compile my project and run it, but it won't debug. It gives me a "cannot connect to VM" error. I did a search on this problem and couldn't come up with an answer to my issue. "localhost" is properly defined in my /etc/hosts file.

Another problem: the JFileChooser class (from the SWING components) seems to really screw up now. It used to work fine. I made no changes to my code. But when I run it under FC5, it gives me a dialog but shows no files even though there are files there. If I attempt to use the dialog at all, it causes some kind of exception.

Anyone know what the problem is with these errors? Are you running Eclipse successfully on FC5? How about the SWING components?

Thanks.

Skunk Worx
21st May 2006, 08:01 PM
I have used it a little. I had terrible problems at the beginning because I installed the JDK straight from sun. I didn't know the native gcj can conflict with that kind of install. After cleaning that up, and doing it the "fedora faq" way (top of this page, using "jpackage.org" instructions) everything is ok now. I can switch between native compiling gcj and sun's java using :


# /usr/sbin/alternatives --config java

There are 2 programs which provide 'java'.

Selection Command
-----------------------------------------------
1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2 /usr/lib/jvm/jre-1.5.0-sun/bin/java

How did you install your JDK?

---
John

mbratch
21st May 2006, 08:17 PM
Thanks for the response John.

I did a straight-up installation from the FC5 install CDs, not using any external java installation.

I ran the "alternatives" command you showed, and mine lists just the 'gcj' install, same as you have (1.4.2).

Is there something in the fedora faq install steps that is "special"? I'll have a look at them...

Skunk Worx
21st May 2006, 08:37 PM
Yes it's special alright....especially if you want Sun's VM! Fedora doesn't ship with Sun's JDK.

FSF/GNU gcj compiles straight to native applications, there are no byte codes to run in a VM (AFAIK).

The whole FSF/GNU gcj/Classpath infrastructure is undergoing rapid development and there are many differences in behavior between Sun's VM based JDK and the FSF/GNU gcj compiled apps.

The whole jpackage thing gives you the option of switching to the Sun VM infrastructure via the "alternatives" command.

---
John

mbratch
21st May 2006, 09:09 PM
Why is "yum -y localinstall..." used to install the rpm's instead of the rpm command?

Skunk Worx
21st May 2006, 09:49 PM
the jpackage setup takes sun's stuff and massages it into RedHat/Fedora compatible rpms on your local machine.

fedora doesn't ship sun's products, so you download sun's official stuff, jpackage massages that into installable rpms on *your local machine*, then you use yum's localinstall option to install your newly crafted rpms.

as to the exact technical reasons that jpackage rpms are superior or preferable to a basic sun style install, i think the original question speaks to that...having the ability to switch on the fly is very nice.

I think they (jpackage) are of the opinion that their infrastructure does a better job of dependency checking across the target system and the JDK than Sun's basic install.

for example, one sun file in gives you :


$ pwd
/usr/src/redhat/RPMS/i586
$ ls -1
java-1.5.0-sun-1.5.0.06-1jpp.i586.rpm
java-1.5.0-sun-alsa-1.5.0.06-1jpp.i586.rpm
java-1.5.0-sun-demo-1.5.0.06-1jpp.i586.rpm
java-1.5.0-sun-devel-1.5.0.06-1jpp.i586.rpm
java-1.5.0-sun-fonts-1.5.0.06-1jpp.i586.rpm
java-1.5.0-sun-jdbc-1.5.0.06-1jpp.i586.rpm
java-1.5.0-sun-plugin-1.5.0.06-1jpp.i586.rpm
java-1.5.0-sun-src-1.5.0.06-1jpp.i586.rpm

...out. By splitting all of these out I assume they get some finer grained control over dependencies. The jpackage.org site doesn't go into a lot of details about this though.

EDIT :
By the way, if you ever find yourself with some free time (haha) it would be neat to see the SWT difference between native and Sun. A simple demo and explanation of the code and steps to reproduce would be very much appreciated in the programming area. I have been planning on doing something like this but have not had a chance yet, and it sounds like you are most of the way there already. Just if you get a chance, though. I know I'd like to see it.

---
John

mbratch
21st May 2006, 10:09 PM
Thank you John. Everything seems to be working fine now.

Skunk Worx
21st May 2006, 11:17 PM
You're welcome, mb. I am still a newb with this environment. A couple corrections :

1) gcj can create bytecode as well as native.
2) just changing the alternative doesn't mean eclipse will use that jvm when running apps.

I just noticed that even though I was setup for Sun's jvm (and therefore running eclipse under that) my test apps were still running under gcj/classpath.

To actually use another jvm for running apps under development, I had to go to eclipse Window->Preferences->Java->Installed JREs and add the other JVM that is in /usr/lib/jvm, then flag it as the default.

I'm sure from your experience with eclipse in RH9 you already knew this, but am posting for completion in case anyone else wants to run their *apps* under another jvm, as opposed to running *eclipse* under an alternate environment.

Also if anyone reads this and has more comments or info on running eclipse and/or apps between the two environments, please share or post url so I can learn more.

Thanks,
John