You can reference it with #{RAILS_ROOT}
So something along the lines of
pipe = IO.popen("java -jar #{RAILS_ROOT}/jars/tstlib.jar")
and then make a jars folder in the root of your app and place your jar
there.
This should work... might require tweaking, look into using
#{RAILS_ROOT} (as I''m still a bit of a newbie here... and to Rails).
Paulo Carvalho wrote:> Hello
>
> With my controller i am executing a JAR file like this:
>
> begin
> pipe = IO.popen("java -jar
D:/Projets/TstSimple/lib/tstlib.jar")
> rescue Exception => e
> msg = e.message
> end
>
> I would like to not have to specified the path of the jar file:
> pipe = IO.popen("java -jar tstlib.jar")
>
> Is there a directory where I can put my JAR file so rails be able to
> execute the java command like this?
>
> Thanks
>
> regards
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---