rubyonrailsin

A Ruby and Rails talk

Sunday, March 28, 2010


[Rails] Re: executing jar files from within rails app

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

You can use system call to execute jar file.

# Change to the directory where jar resides
Dir.chdir("#{RAILS_ROOT}/public/<dirname>/") do

# Execute jar
retResult = system("<path to java> -jar <jarname> <args 1> <args
2> .. <args n> ")

if retResult
Jar executes succesfully
else
error in executing jar file.

end #chdir

Thanks
Senling

On Mar 29, 12:10 am, Gautam <gdham...@gmail.com> wrote:
> I have a rails app and a jar file.
> I want my jar file to execute when the user presses a button on the
> webpage.
> Please tell me how to do that.
>
> Any help will be highly appreciated.
> Thanks in anticipation. :)

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive