[R-pkg-devel] GitHub Actions - CI for pkg that depends on Java/rJava (Windows issue)

Blätte, Andreas @ndre@@@b|@ette @end|ng |rom un|-due@de
Fri Jan 22 17:38:27 CET 2021

Dear colleagues,

as recommended by rOpenSci (see https://ropensci.org/technotes/2020/11/19/moving-away-travis/) , I am moving to GitHub Actions for the CI for my R packages.

My test case is the “bignlp” package I currently develop (https://github.com/https://github.com/PolMine/bignlpPolMine/bignlp). It is an interface to use the CoreNLP tools which are written in Java. (To explain: Unlike other existing packages that interface to CoreNLP, my intent is to make full use of Java multithreading.)

Having used `usethis::use_github_action_check_full(),  CI works almost out of the box on the Ubuntu and macOS test environments. But I have a problem to ensure that rJava can find Java. The error I see (Windows, both architectures):

Error: Error: R CMD check found ERRORs
Execution halted
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'D:/a/_temp/Library/rJava/libs/i386/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.

(For the full log, see: https://github.com/PolMine/bignlp/runs/1749892186)

My first take was to add a step that would make sure that Java is present to .github/workflows/R-CMD-check.yaml:

      - name: Install Java
        uses: actions/setup-java using v1
          java-version: '8'
          java-package: jdk

But that only breaks things CI on Linux without having any change on Windows.

I have consulted the manual ‘GitHub Actions with R’ (https://ropenscilabs.github.io/actions_sandbox/), but it does not address Java issues. I tried to find some R package on GitHub that would have rJava as a dependency and that uses GitHub Actions for CI – without success.

This is why I’d like to query your experience: How I can make GitHub Actions work on Windows for the scenario of a package that depends on Java/rJava. Many thanks in advance!

Kind regards
Andreas (Blätte)

Prof. Dr. Andreas Blätte
Professor of Public Policy and Regional Politics
University of Duisburg-Essen

	[[alternative HTML version deleted]]

More information about the R-package-devel mailing list