<p>To locally call R from Java, you need JRI. To remotely call Java you can use RServe. If you want to handle graphics, that is best done using something in R such as the evaluate package. Afaik most language bridges offer no particular functionality for handling graphics, you will need to do that on the R level. </p>

<p>Have a look at <a href="http://arxiv.org/pdf/1406.4806.pdf" rel="nofollow">this paper</a> before you get started to be aware of the challenges and limitations of using cross language bridges for scientific computing. You'll save yourself a lot of trouble down the line.</p>
Integrate R in java web application
<p>I know there are multiple questions resembling this one but most of them are &gt;2 years old and actually not that related.</p>
<p>What I need to do is fully integrate the R environment in an existing java (actually scala) application. I don't want any R-based web solutions like Rook, Rapache and the like, the server logic happens strictly in java land. What I need is a way to send R commands to the interpreter, let it run them and handle the output. More importantly, I need to be able to:</p>
<ol>
<li><p>Run commands interactively not only ready-made R scripts.</p>
</li>
<li><p>Produce and handle graphics from the established graphics packages.</p>
</li>
<li><p>Communicate raw data back and forth between the JVM and R interpreter.</p>
<p>I am aware of <a href="http://www.rforge.net/JRI/" rel="nofollow noreferrer">JRI</a>. I would very much appreciate to hear from anyone who has used it. How stable is it? How actively maintained is the project? Any existing code that I can look at? Any other alternatives out there?</p>
</li>
</ol>