Skip to content

Commit 558e856

Browse files
committed
update readme
1 parent e5d3e09 commit 558e856

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ alt="CRAN/METACRAN Total downloads" /></a>
2323
<!-- [![pkgcheck](https://github.com/e-kotov/rJavaEnv/workflows/pkgcheck/badge.svg)](https://github.com/e-kotov/rJavaEnv/actions?query=workflow%3Apkgcheck) -->
2424
[![codecov](https://codecov.io/github/e-kotov/rJavaEnv/graph/badge.svg?token=2UKGZVNO5V)](https://app.codecov.io/github/e-kotov/rJavaEnv)
2525

26-
[![DOI](https://zenodo.org/badge/DOI/10.32614/CRAN.package.rJavaEnv.svg)](https://doi.org/10.32614/CRAN.package.rJavaEnv)
26+
[![DOI](https://zenodo.org/badge/DOI/10.32614/CRAN.package.rJavaEnv.svg)](https://doi.org/10.32614/CRAN.package.rJavaEnvi)
2727
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11403009.svg)](https://doi.org/10.5281/zenodo.11403009)
2828

2929
<!-- badges: end -->
@@ -115,6 +115,19 @@ and/or to prevent interruptions in non-interactive mode, you can use the
115115
rje_consent(provided = TRUE)
116116
```
117117

118+
## Using `rJavaEnv` with `targets` and `callr`
119+
120+
Just insert this line into the begining of any script that you run with
121+
`targets` or `callr`:
122+
123+
``` r
124+
rJavaEnv::use_java("21")
125+
```
126+
127+
More details are in the vignette [Multiple `Java` environments in one
128+
project with `targets` and
129+
`callr`](https://www.ekotov.pro/rJavaEnv/articles/multiple-java-with-targets-callr.qmd).
130+
118131
## Functions Overview
119132

120133
The package has several core functions:

README.qmd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,19 @@ As part of normal operation, `rJavaEnv` will update the `JAVA_HOME` and `PATH` e
9696
rje_consent(provided = TRUE)
9797
```
9898

99+
## Using `rJavaEnv` with `targets` and `callr`
100+
101+
Just insert this line into the begining of any script that you run with `targets` or `callr`:
102+
103+
```r
104+
rJavaEnv::use_java("21")
105+
```
106+
107+
This acts exactly like `java_quick_install()`, but only sets the environment variables in the current session and does not copy or link `Java` binaries into the project directory.
108+
109+
More details are in the vignette [Multiple `Java` environments in one project with `targets` and `callr`](https://www.ekotov.pro/rJavaEnv/articles/multiple-java-with-targets-callr.qmd).
110+
111+
99112
## Functions Overview
100113

101114
The package has several core functions:
@@ -127,6 +140,9 @@ The package has several core functions:
127140
9. `java_clear()`
128141
* Removes all or some `Java` versions linked in the current project (or cached distributions or installations).
129142

143+
10. `use_java()`
144+
* Same as `java_quick_install()`, but in a less intrusive way. Does not copy or link the `Java` installation folder from cache into the project directory and does not create or edit your `.Rprofile` file. Only sets requested java in the current R session.
145+
130146
See more details on all the functions in the [Reference](https://www.ekotov.pro/rJavaEnv/reference/index.html){target="_blank"}.
131147

132148

0 commit comments

Comments
 (0)