# Create custom jruby-complete.jar

**URL:** <https://www.ruby-forum.com/t/create-custom-jruby-complete-jar/166116>\
**Category:** JRuby\
**Created:** [April 22, 2009, 12:55am UTC](https://www.ruby-forum.com/t/create-custom-jruby-complete-jar/166116 "2009-04-22T00:55:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![roytruelove](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3ab097/32.png) [@roytruelove](https://www.ruby-forum.com/u/roytruelove)\
**Post date:** [April 22, 2009, 12:55am UTC](https://www.ruby-forum.com/t/create-custom-jruby-complete-jar/166116/1 "2009-04-22T00:55:51Z")

</div>

Hello all,

I’ve read rumors that this is possible, but I haven’t been able to find  
instructions: how do I build a custom jruby-complete.jar (i.e. including  
gems that are not part of the standard jruby-complete.jar).

Thanks,  
Roy

---

<div class="post-metadata">

**Author:** ![roytruelove](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3ab097/32.png) [@roytruelove](https://www.ruby-forum.com/u/roytruelove)\
**Post date:** [April 22, 2009, 1:31am UTC](https://www.ruby-forum.com/t/create-custom-jruby-complete-jar/166116/2 "2009-04-22T01:31:34Z")

</div>

A jar file is just a zip with some extra data. You can unzip the  
jruby-complete.jar file, add/remove items at your leisure (gem unpack)  
and then zip it all back up again.

David K.

On Apr 21, 2009, at 3:55 PM, Roy T. wrote:

> Hello all,
> 
> I’ve read rumors that this is possible, but I haven’t been able to  
> find instructions: how do I build a custom jruby-complete.jar (i.e.  
> including gems that are not part of the standard jruby-complete.jar).
> 
> Thanks,  
> Roy

* * *

To unsubscribe from this list, please visit:

```
http://xircles.codehaus.org/manage_email

```

---

<div class="post-metadata">

**Author:** ![roytruelove](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3ab097/32.png) [@roytruelove](https://www.ruby-forum.com/u/roytruelove)\
**Post date:** [April 22, 2009, 5:20am UTC](https://www.ruby-forum.com/t/create-custom-jruby-complete-jar/166116/3 "2009-04-22T05:20:01Z")

</div>

Roy T. wrote:

> Hello all,
> 
> I’ve read rumors that this is possible, but I haven’t been able to find  
> instructions: how do I build a custom jruby-complete.jar (i.e. including  
> gems that are not part of the standard jruby-complete.jar).

Look at the jar-complete target in build.xml.

In there, there is a maybe\_install\_gems command where you should be able  
to add more gems for it to install into the staging directory before it  
jars it up.

This has not been tried as such, but I have tinkered with the same spot  
in the build to make it _not_ install the gems to there (I manually copy  
them from elsewhere to avoid using the network during the build.)

TX

---

<div class="post-metadata">

**Author:** ![roytruelove](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3ab097/32.png) [@roytruelove](https://www.ruby-forum.com/u/roytruelove)\
**Post date:** [April 22, 2009, 8:36am UTC](https://www.ruby-forum.com/t/create-custom-jruby-complete-jar/166116/4 "2009-04-22T08:36:50Z")

</div>

Roy T. wrote:

> Hello all,
> 
> I’ve read rumors that this is possible, but I haven’t been able to find  
> instructions: how do I build a custom jruby-complete.jar (i.e. including  
> gems that are not part of the standard jruby-complete.jar).

As David pointed out, it’s just a zip file of a particular structure, so  
you can modify it yourself. I believe some folks have done exactly what  
you hope to do, e.g. including gem-based libraries directly in the jar  
file.

I would, however, like to automate this process. It would not be  
difficult to build a “complete jar builder” that also sucked in  
installed gems (perhaps based on a list or based on checking loaded gems  
in a bootstrapped application?) and included them in the complete jar.  
This would make shipping applications much easier.

Since it’s just a zip file, maybe you or someone else can come up with a  
script to install gems? We could then improve it and probably include it  
in JRuby.

- Charlie

* * *

To unsubscribe from this list, please visit:

```
http://xircles.codehaus.org/manage_email

```
