开发者

using aws sdk for java in Jruby

开发者 https://www.devze.com 2023-01-29 00:25 出处:网络
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.

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

精彩评论

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