Require war file within JRuby

Hello,

I am a beginner with JRuby so please show mercy.

My question is that can I require a war file within JRuby? When I do a
require ‘file.war’ I get an error about not being able to load?

testJava.rb:5:in `require’: no such file to load

However, when I do a require for axis.jar (present in the same
directory, it
works fine. My question is can war files be required the same way as jar
files especially since they have the same format?

many thanks
frank

On Mon, Jul 28, 2008 at 10:47 AM, Frank H. [email protected]
wrote:

works fine. My question is can war files be required the same way as jar
files especially since they have the same format?

Typically war files are web applications which have content files as
well as a WEB-INF directory, with embedded jar files in them. The
require jar mechanism simply adds the jar file to the classpath that
JRuby sees. So this doesn’t work for the same reason that you don’t
put war files on the classpath in a java application. If there are jar
files inside the war that you want to use, you probably should just
unpack those and require them directly.

Cheers,
/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thank you, Nick, I appreciate your assistance.

frank

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs