Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

New Post: Error in .jinit(): Cannot create Java virtual machine (-4)

$
0
0
This worked just fine for me with no particular setup compared to other code run via R.NET. I used the latest R.NET development code but don't see any reason why this would not work with R.NET 1.5.5.
privatestaticvoid ReproDiscussion537259(REngine e)
      {
         e.Evaluate("library(rJava)");
         e.Evaluate(".jinit()");
         e.Evaluate("f <- .jnew('java/awt/Frame','Hello')");
         e.Evaluate(".jcall(f,,'setVisible',TRUE)");
      }
The error message is in the native code of rJava (rJava\src\init.c) when a call to JNI_CreateJavaVM fails. I dug around to find the meaning error code (-4). I am nonplussed, to say the least, by searching through https://search.oracle.com.

Your JVM seems to complain about a lack of contiguous memory to initialise. This is very likely to be machine specific, so you'll have to use your Java know-how to figure out what to do. The first useful hint I came accross was in an old post. A problem described on StackOverflow seems also to share some technical characteristics with your issue.

Hope this helps. Please post a reply if you find a work around your issue.

Viewing all articles
Browse latest Browse all 1634

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>