# Jruby and ubuntu and libgcj

**URL:** <https://www.ruby-forum.com/t/jruby-and-ubuntu-and-libgcj/145553>\
**Category:** Ruby\
**Created:** [August 11, 2008, 2:39pm UTC](https://www.ruby-forum.com/t/jruby-and-ubuntu-and-libgcj/145553 "2008-08-11T14:39:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axel\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Post date:** [August 11, 2008, 2:39pm UTC](https://www.ruby-forum.com/t/jruby-and-ubuntu-and-libgcj/145553/1 "2008-08-11T14:39:59Z")

</div>

Dear all,

I have problems using jruby (1.1.3) on ubuntu 8.04, libgcj 4.2.3:

axel@alecrim:~$ jruby -v  
Exception in thread “main” java.lang.NoClassDefFoundError:  
org.jruby.Main  
at gnu.java.lang.MainThread.run(libgcj.so.81)  
Caused by: java.lang.ClassNotFoundException: org.jruby.Main not found in  
gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/local/jruby-1.1.3/lib/bsf.jar,file:/usr/local/jruby-1.1.3/lib/profile.jar,file:./],  
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}  
at java.net.URLClassLoader.findClass(libgcj.so.81)  
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.81)  
at java.lang.ClassLoader.loadClass(libgcj.so.81)  
at java.lang.ClassLoader.loadClass(libgcj.so.81)  
at gnu.java.lang.MainThread.run(libgcj.so.81)

> gij --version  
> java version “1.5.0”  
> gij (GNU libgcj) version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)

I found a similar bug report about earlier versions of jruby/ubuntu/gij  
versions here,  
where it is filed as a resolved bug … however, I can’t resolve it on  
my system:

[http://jira.codehaus.org/browse/JRUBY-2254](http://jira.codehaus.org/browse/JRUBY-2254)

Thank you for your help.

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![Axel\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Post date:** [August 11, 2008, 6:32pm UTC](https://www.ruby-forum.com/t/jruby-and-ubuntu-and-libgcj/145553/2 "2008-08-11T18:32:19Z")

</div>

Axel E. wrote:

> at java.lang.ClassLoader.loadClass(libgcj.so.81)  
> at java.lang.ClassLoader.loadClass(libgcj.so.81)  
> at gnu.java.lang.MainThread.run(libgcj.so.81)

As far as I know, JRuby 1.1.3 neither compiles nor runs on GCJ, mostly  
because it’s missing several tools and libraries we need. We’re  
certainly open to someone getting it running, but with all the Linux  
distros now providing installable OpenJDK-based JVMs, there’s hasn’t  
been much interest in getting GCJ to work.

- Charlie

---

<div class="post-metadata">

**Author:** ![Axel\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Post date:** [August 11, 2008, 7:43pm UTC](https://www.ruby-forum.com/t/jruby-and-ubuntu-and-libgcj/145553/3 "2008-08-11T19:43:14Z")

</div>

-------- Original-Nachricht --------

> Datum: Tue, 12 Aug 2008 01:26:44 +0900  
> Von: Charles Oliver N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> An: removed\_email\_address@domain.invalid  
> Betreff: Re: jruby and ubuntu and libgcj

> gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/local/jruby-1.1.3/lib/bsf.jar,file:/usr/local/jruby-1.1.3/lib/profile.jar,file:./],  
> distros now providing installable OpenJDK-based JVMs, there’s hasn’t  
> been much interest in getting GCJ to work.
> 
> - Charlie

Dear Charles,

thank you for responding. Could you advise which java virtual machine  
should  
be used for stress-free Jruby usage 🙂 ?

Thank you,

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![Axel\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Post date:** [August 11, 2008, 9:20pm UTC](https://www.ruby-forum.com/t/jruby-and-ubuntu-and-libgcj/145553/4 "2008-08-11T21:20:37Z")

</div>

On Mon, Aug 11, 2008 at 1:39 PM, Axel E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> thank you for responding. Could you advise which java virtual machine should  
> be used for stress-free Jruby usage 🙂 ?

(On Linux) I have either used Sun’s Java 6 JDK or (more recently  
moving toward) OpenJDK. I think on my Ubuntu box at home, I still  
have Sun’s release installed; but, Ubuntu 8.10 should have OpenJDK  
baked in:

[https://lists.ubuntu.com/archives/ubuntu-devel-announce/2008-July/000460.html](https://lists.ubuntu.com/archives/ubuntu-devel-announce/2008-July/000460.html)

---

<div class="post-metadata">

**Author:** ![Axel\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Post date:** [August 11, 2008, 11:00pm UTC](https://www.ruby-forum.com/t/jruby-and-ubuntu-and-libgcj/145553/5 "2008-08-11T23:00:51Z")

</div>

-------- Original-Nachricht --------

> Datum: Tue, 12 Aug 2008 04:16:58 +0900  
> Von: removed\_email\_address@domain.invalid  
> An: removed\_email\_address@domain.invalid  
> Betreff: Re: jruby and ubuntu and libgcj

> > thank you for responding. Could you advise which java virtual machine  
> > should  
> > be used for stress-free Jruby usage 🙂 ?
> 
> (On Linux) I have either used Sun’s Java 6 JDK or (more recently  
> moving toward) OpenJDK. I think on my Ubuntu box at home, I still  
> have Sun’s release installed; but, Ubuntu 8.10 should have OpenJDK  
> baked in:
> 
> [Java related changes in intrepid](https://lists.ubuntu.com/archives/ubuntu-devel-announce/2008-July/000460.html)

… and it now works like a charm. Thank you very much !

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![Axel\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Post date:** [August 12, 2008, 4:17am UTC](https://www.ruby-forum.com/t/jruby-and-ubuntu-and-libgcj/145553/6 "2008-08-12T04:17:20Z")

</div>

On Monday 11 August 2008 11:26:44 Charles Oliver N. wrote:

> with all the Linux  
> distros now providing installable OpenJDK-based JVMs, there’s hasn’t  
> been much interest in getting GCJ to work.

Would there be any performance increase?

That is: Does GCJ actually compile to binary? Or is it more like a  
wrapper for  
some sort of VM?

My understanding is, it might at least reduce start time. But that’s  
probably  
not a reason to put a huge amount of effort into it.

---

<div class="post-metadata">

**Author:** ![Axel\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Post date:** [August 12, 2008, 11:13am UTC](https://www.ruby-forum.com/t/jruby-and-ubuntu-and-libgcj/145553/7 "2008-08-12T11:13:06Z")

</div>

David M. wrote:

> My understanding is, it might at least reduce start time. But that’s probably  
> not a reason to put a huge amount of effort into it.

GCJ is generally a lot slower at everything but startup time, because it  
lacks the ability to do the runtime optimizations that are typically  
responsible for Java’s best performance. My understanding is that it  
does compile to something mostly native with a very large runtime  
library (large as in comparable to what a JVM would be, or perhaps a bit  
smaller), and that native-compiled code starts up rather fast. But most  
numbers indicate that when the app is up and going, performance is not  
as good as, for example, OpenJDK.

Like I say, though, we’d welcome someone helping to get JRuby running on  
GCJ. It did at one point, but as we started to incorporate more Java 5+  
features it started to slip away. And with OpenJDK basically making  
Sun’s HotSpot JVM free AND Free, there’s been almost no demand for GCJ  
over the past several months. Hell, even Debian has approved OpenJDK for  
inclusion, and they were dead-set on requiring that all Free Java-based  
apps be GCJ-compatible for the longest time (keeping JRuby out of the  
dist for the past year or so).

- Charlie
