Skip to content

Commit 6090e88

Browse files
committed
vignette links
1 parent a4e5a5a commit 6090e88

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

vignettes/rJavaEnv-step-by-step.qmd

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pkgdown:
1212
---
1313

1414

15-
The basics of using `rJavaEnv` are covered in the [Quick Start Guide](rJavaEnv.qmd), which demonstrates how to install Java in one line of code. This guide will show you how to have a more fine-grained control over your Java environment.
15+
The basics of using `rJavaEnv` are covered in the [Quick Start Guide](rJavaEnv.qmd), which demonstrates how to install Java in one line of code. This guide will show you how to have a more fine-grained control over your Java environments. Also see the [vignette on using `rJavaEnv` with the `targets` and `callr` packages to manage multiple `Java` environments](multiple-java-with-targets-callr.qmd).
1616

1717
```{r}
1818
library(rJavaEnv)
@@ -153,7 +153,7 @@ Example expected output:
153153
Java distributions cache cleared.
154154
```
155155

156-
### 4. Install from downloaded `Java` JDK distributions
156+
### 4. Install from downloaded `Java` JDK distributions into current project
157157

158158
As we have cleared all downloaded `Java` distributions, let us re-download a few of them:
159159

@@ -184,6 +184,15 @@ C:/Users/user_name/AppData/Local/Temp/75/Rtmp0MasTW/rjavaenv/windows/x64/17
184184

185185
If we did leave `autoset_java_env = TRUE` which is a default option, `install_java()` function would automatically set the `JAVA_HOME` and `PATH` environment variables manually in both the current `R` session and in the current project/working directory by writing a few lines into the `.Rprofile` file in the current working directory. This way each time you would start an R session, the `JAVA_HOME` and `PATH` environment variables would be set to the correct path to the installed `Java` distribution.
186186

187+
Alternatively, you may want to not install `Java` into your project, but just unpack the distribution into the cache folder. For this, you can use the `java_unpack()` function, passing it the path to the downloaded `Java` distribution from before:
188+
189+
```{r}
190+
java_home <- java_unpack(java_distr_path = java_8_distr)
191+
```
192+
193+
`java_unpack` will return full path to the unpacked `Java` distribution that you can use to set the environment variables in the section below using `java_env_set()`.
194+
195+
187196
### 5. Manually set installed `Java` environment
188197

189198
Let us install another downloaded `Java` distribution, this time with `autoset_java_env = TRUE`:

0 commit comments

Comments
 (0)