Can it access C or java API

Hi
I am trying to evaluate if RoR is the right choice for my application.
My application has to use some third party java apis (or even C), is it
possible to use them from RoR code? It may also want to read from some
text files, so is there any File I/O support available?

thanks
Rupak