开发者

using aws sdk for java in Jruby

I have an app which uses the amazon web services.The app is installed with jruby on rails.I have to use java开发者_如何学Python aws sdk for calling amazon web services.

Can u help me as in how to include aws sdk in my app and use it

Thanx in advance


You will want to put the jar files for the sdk inside your /lib/java folder, and make sure to include them in your classpath. (See this example on including a JDBC driver, same concept.)

Then to use the objects in Ruby you just instantiate them like you normally would:

require 'java'

myAwsObj = com.amazon.aws.class.someMethod('some','params')

You can visit the JRuby Kenai site for examples of calling Java from inside Ruby. Obviously the package name above I made up, but you should get the idea from there. The Kenai page also has lots of other examples and gotchas.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜