Check out the JRI/rJava project which provides a Java/R interface. After you download the package, see the examples directory.
Another option is to use the RCaller library (though I‘ve never tried it myself...this question suggests potential performance issues).
REF
https://stackoverflow.com/questions/8509120/how-can-i-use-java-to-output-an-r-graph
原文:https://www.cnblogs.com/emanlee/p/13946439.html