{"id":450,"date":"2013-07-28T13:17:45","date_gmt":"2013-07-28T05:17:45","guid":{"rendered":"http:\/\/blog.dayandcarrot.net\/?p=450"},"modified":"2013-07-28T13:17:45","modified_gmt":"2013-07-28T05:17:45","slug":"eclipse-jri-%ef%bc%9a-java-%e8%b0%83%e7%94%a8-r-%e6%8a%a5%e9%94%99%ef%bc%9a-cannot-find-jri-native-library","status":"publish","type":"post","link":"https:\/\/dayandcarrot.space\/?p=450","title":{"rendered":"Eclipse JRI \uff1a Java \u8c03\u7528 R \u62a5\u9519\uff1a Cannot find JRI native library!"},"content":{"rendered":"<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr valign=\"top\">\n<td>Q:<\/td>\n<td><i>I get the following error, what&#8217;s wrong?<br \/>\n<tt>java.lang.UnsatisfiedLinkError: no jri in java.library.path<\/tt><\/i><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td>A:<\/td>\n<td>Usually it means that you didn&#8217;t setup the necessary environment variables properly or the JRI library is not where it is expected to be. The recommended way to start JRI programs is to use the\u00a0<tt>run<\/tt>\u00a0script which is generated along with the library. It sets everything up and is tested to work. If you want to write your own script or launcher, you must observe at least the following points:<\/p>\n<ul>\n<li><tt>R_HOME<\/tt>\u00a0must be set correctly<\/li>\n<li>(Windows): The directory containing\u00a0<tt>R.dll<\/tt>\u00a0must be in your\u00a0<tt>PATH<\/tt><\/li>\n<li>(Mac): Well, it&#8217;s a Mac, so it just works ;).<\/li>\n<li>(unix): R must be compiled using\u00a0<tt>--enable-R-shlib<\/tt>\u00a0and the directory containing\u00a0<tt>libR.so<\/tt>\u00a0must be in\u00a0<tt>LD_LIBRARY_PATH<\/tt>. Also\u00a0<tt>libjvm.so<\/tt>\u00a0and other dependent Java libraries must be on\u00a0<tt>LD_LIBRARY_PATH<\/tt>.<\/li>\n<li><span style=\"color: #ff0000;\">JRI library must be in the current directory or any directory listed in\u00a0<tt>java.library.path<\/tt>. Alternatively you can specify its path with\u00a0<\/span><br \/>\n<tt>-Djava.library.path=<\/tt>\u00a0when starting the JVM. When you use the latter, make sure you check\u00a0<tt>java.library.path<\/tt>\u00a0property first such that you won&#8217;t break your Java.<\/li>\n<li>Depending on your system, the R verison and other features you want to use, you may have to set additional settings such as\u00a0<tt>R_SHARE_DIR<\/tt>,\u00a0<tt>R_INCLUDE_DIR<\/tt>\u00a0and<tt>R_DOC_DIR<\/tt>.<\/li>\n<\/ul>\n<p>Again, I don&#8217;t think you want to worry about all of the above &#8211; just use the start script!<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7279\u522b\u6ce8\u610f\u7ea2\u5b57\u6807\u6ce8\u7684\u8fd9\u4e00\u884c\uff0c<br \/>\n<a href=\"http:\/\/orz.dayandcarrot.net\/wordpress\/wp-content\/uploads\/2013\/07\/QQ\u622a\u56fe20130728131711.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-451\" alt=\"QQ\u622a\u56fe20130728131711\" src=\"http:\/\/orz.dayandcarrot.net\/wordpress\/wp-content\/uploads\/2013\/07\/QQ\u622a\u56fe20130728131711.gif\" width=\"558\" height=\"206\" \/><\/a><br \/>\n\u5728\u8fd9\u8fb9\u4fee\u6539\u5b9e\u73b0\u5373\u53ef\u3002<br \/>\n\u53c2\u8003\uff1a<a href=\"http:\/\/www.rforge.net\/JRI\/\">http:\/\/www.rforge.net\/JRI\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q: I get the following error, what&#8217;s wrong? java.lang.UnsatisfiedLinkError: no jri in java.library.path A: Usually it means that you didn&#8217;t setup the necessary environment variables properly or the JRI library is not where it is expected to be. The recommended way to start JRI programs is to use the\u00a0run\u00a0script which is generated along with the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[60,91],"class_list":["post-450","post","type-post","status-publish","format-standard","hentry","category-study","tag-java","tag-r"],"_links":{"self":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/posts\/450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=450"}],"version-history":[{"count":0,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/posts\/450\/revisions"}],"wp:attachment":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}