-
Could you advice how can I remove the java-objects from R-code or change .jaddClassPath dynamically? I have create the j object by the next script
after that script I use quotes.model to make some calculations in R But, later I need to create new object, but I cant't
Maybe I need to remove the quotes.model, but I can't
How I can remove Java-object? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You cannot remove loaded classes from Java*. However what you seem to want is to simply to load another version of the class which you can if you simply use another class loader. That's exactly what Lines 42 to 50 in 6d362c1 Once you have a new loader, just use it as (*) - in theory it's possible if the class loader and all classes that it loaded get garbage-collected in Java. However that is really hard to guarantee since a single reference anywhere in Java is enough to stop that. |
Beta Was this translation helpful? Give feedback.
You cannot remove loaded classes from Java*.
However what you seem to want is to simply to load another version of the class which you can if you simply use another class loader. That's exactly what
.jpackage(.., own.loader=TRUE)
does so you can have a look here:rJava/R/loader.R
Lines 42 to 50 in 6d362c1
Once you have a new loader, just use it as
c…