Skip to content

R + Java #52

Description

@ariannaa7

Depends a bit on how you've installed java (package manager vs. direct download)

1. Terminal

# Homebrew
brew info openjdk  
ls /opt/homebrew/opt/openjdk # expected installation location
brew --prefix openjdk # prints actual installation path (should be /opt/homebrew/opt/openjdk)
brew list | grep openjdk  

# Look for installs on computer
/usr/libexec/java_home -V  # list all java installs on computer


# R CMD javareconf # R reconfiguration

export JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home # output either from /usr/libexec/java_home -V or brew --prefix openjdk
sudo R CMD javareconf # R reconfiguration with admin privileges

2. R

# Then restart R session!
install.packages("rJava") # should work now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions