Repository navigation
Allow J() convenience on Java 17+ #345
Description
Activity
- added a commit that references this issue
on Nov 12, 2025 Many thanks!
Sorry, this had to be reverted, because it causes failure in reverse-dependencies, so will require more investigation.
The failure report (from R CMD check):
streamMOA:
Error in .jcheck(silent = FALSE) : java.lang.IllegalAccessException: class RJavaTools cannot access a member of class StreamMOA with modifiers "public static" Calls: update ... update.DSC_MOA -> J -> .jrcall -> .jcall -> .jcheck@vpinna80 any hope you have a minute to check? I'm currently swamped so can't really have a look right now :(
Hi @s-u , I could look at it but I need some more info.
Which Java version was used in the test?
Is this bug resulting from a test that's part of the streamMOA unit tests, or was it just a bug discovered by usage?@vpinna80 Thanks! It is a report from
R CMD check streamMOA(that's how CRAN does rev.dep. checks). I think Kurt uses latest Debian Java so probably 21.- added a commit that references this issue
on Mar 12, 2026 Hi @s-u , sorry to come back to you this late.
Can you confirm that streamMOA isn't working with java 8? I looked at the code and it seems to me that the package isn't compatible with any java > 8. In particular, the Java classes in the package are not public, so their fields aren't accessible; no patch can allow for this accesses on any java > 8.
You said that the reverse dependencies tests were run with java 21. What version did you use before this patch? Go back to it and use this rJava with the same Java version you were using before.
Note that this patch doesn't automatically make all existing packages compatible with java > 8. The purpose of this patch is to allow packages that both require and are already compatible with Java 17 to run without errors.
- added a commit that references this issue
on Mar 24, 2026
With current implementation, some legitimate Java calls fail because of access to private methods in Java 17+, where setAccessible doesn't work anymore.
For example, the following fails though the Map class and all the methods are public:
In this case, and in similar cases, you have to resort to .jcall which is cumbersome because you have to remember the actual parameter classes, and the return type.
Expected behavior: