s-u / rJava

R to Java interface
https://RForge.net/rJava
235 stars 77 forks source link

Can you modernize rJava output for all its stop() and warning() functions to make them more user friendly? #291

Closed mlane3 closed 2 years ago

mlane3 commented 2 years ago

"Error: package or namespace load failed for ‘rJava’: .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures."

I have several problems with the above statement.

  1. It does not print or explain what a CurrentVersion entry is. It does not provide the end user any useful information to figure out registry key issues.
  2. It does not explain to a the end user what architecture, but it assumes that the user has hardware knowledge of computers
  3. It relies person knowing how to get help in R. You have to use forum or stackoverflow posts in order to be interpreted in layman terms.

For all these reasons, I feel that there needs to be an overhaul of the stop() and warning statement of this statement and others for base R.

Thanks for understanding,

The poor code monkey... .... who has to reinstall Java on people computers because of poor architecture version control on Windows... ... And attend meetings just to explain to people why version of Java "has to be updated". And do this once every 3 days since 2021 ...

s-u commented 2 years ago

@mlane3 I appreciate your input, but please suggest what you think will help those users you are referring to. To me the message is very clear and explicitly mentions the solution - install Java for the architecture you're using.

rJava cannot really know the reason why the registry setting is missing - it could be either that the user never installed Java or that they did, but for the wrong architecture, or they installed it in some non-standard way. Since rJava can only see the registry for its own architecture it doesn't know more - the user should.

Also I'm not sure what you mean by "others for base R".

R is an analytic and programming language not a point-and-click video game, so it requires some basic knowledge of statistics and computing to be useful, so I can't see how someone who cannot understand such simple error would be capable of using R in any useful way. As I said, if you think there is something missing, please feel free to re-formulate, but the error is already quite verbose. As far as I can tell it contains all necessary information: the underlying problem (missing registry entry) and well as instructions to remediate (instal matching Java).

As for other messages, rJava is a low-level interface between complex systems, it requires that you are familiar with the concepts of both languages involved (Java and R), so you should have quite advanced computing knowledge when using it and thus interpretation of errors should not be a problem. Again, if you have any specifics where you think the error is incorrect or misleading, please, submit a PR and I'm more than happy to review contributions.