You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strange!! Are you using RStudio here? I see this message:
To open Rstudio, you need to install the legacy java SE 6 runtime.
What version of RStudio are you using? What happens if you run this program in your terminal? It would be good to know if this is a problem that xlsx is having or if xlsx is just highlighting and underlying issue in the IDE / elsewhere.
Sys.setenv(JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home')
install.packages("rJava",type='source')
remotes::install_github("colearendt/xlsx",force = TRUE)
library(xlsx)
library(readxl)
library(rJava)
d <- read.table("test_table.txt", sep="\t", header=TRUE, fill=TRUE, row.names = 1, as.is = T)
wb <- createWorkbook()
sheet <- createSheet(wb, "Sheet")
addDataFrame(d, sheet)
rows <- getRows(sheet)
...
...
#Everything is fine till running this command:
cs1 <- CellStyle(wb) + Fill(backgroundColor="lavender")
R encounter a fetal error:
No java runtime present, requesting install.
To open Rstudio, you need to install the legacy java SE 6 runtime.
R version 4.0.2 (2020-06-22) -- "Taking Off Again"
yifengyuan@YifengMacAir ~ $ sudo R CMD javareconf
Password:
Java interpreter : /usr/bin/java
Java version : 17.0.1
Java home path : /Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home/include/darwin -I/usr/local/include -fPIC -Wall -g -O2 -c conftest.c -o conftest.o
clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o conftest.so conftest.o -L/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home/lib/server -ljvm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
JAVA_HOME : /Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
Java library path: $(JAVA_HOME)/lib/server
JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin
JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.
yifengyuan@YifengMacAir ~ $ java -version
java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
Please advice. Thank you very much.
The text was updated successfully, but these errors were encountered: