Add Linux support for easy rJava loading, add env setting for building rJava from source an all platforms#84
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New features
Linux support. On Linux,
libjvm.solocation is automatically detected and force-loaded viadyn.load(). Thanks to that,rJavaand any depenent R packages can be installed and loaded, if repositories with pre-built packages, such asPosit Package Manager, is used or if you buildrJavafrom source, see thejava_build_env_set()function.New function
java_build_env_set()that sets the environment (either temporarily in the current session or in./.Rprofilefile of the current working directory) to buildrJavafrom source onmacOS,LinuxandWindowsplatforms. It uses the current value ofJAVA_HOMEenvironment variable by default, so that it is more convenient to use afterjava_quick_install()oruse_java()commands. After runningjava_build_env_set(), users can installrJavafrom source withinstall.packages("rJava", type = "source")without any additional configuration. However, users will still need some system dependencies, e.g. on Linux they will need: libpcre2-dev, libdeflate-dev, libzstd-dev, liblzma-dev, libbz2-dev, zlib1g-dev, libicu-dev. A system message with a suggestedapt-getcommand is printed. On Windows,Rtoolsmust be installed. OnmacOS,Xcode Command Line Toolsmust be installed. See the new vignetteInstall 'rJava' from sourcefor more details.Improvements
java_quick_install()now also invisibly returns the path toJAVA_HOME.Added
{rlang}as a dependency, as{cli}uses it anyway for the functions that we use in{rJavaEnv}, but does not declare it as a dependency. Therefore this previously might have caused annoyances to the users, as after installing{rJavaEnv}they could not use any of the functions until they installed{rlang}manually.Other minor bugfixes.
Will close #3 and #16 .
java_build_env_set()function is as much as we can do. If the user does not have enough privileges to install required build tools on their system or inside a container, there is nothing else we can do.