Skip to content

Commit 5b1b837

Browse files
committed
update vignettes with cleanup and interlink them
1 parent 4e95fa0 commit 5b1b837

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

README.qmd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,21 @@ This acts exactly like `java_quick_install()`, but only sets the environment var
108108

109109
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).
110110

111+
## Cleanup
112+
113+
If you do not want to use `rJavaEnv` anymore, please clear the cache folders before removing the package:
114+
115+
```{r}
116+
java_clear("project", delete_all = TRUE)
117+
java_clear("installed", delete_all = TRUE)
118+
java_clear("distrib", delete_all = TRUE)
119+
```
120+
121+
Also, clear the `.Rprofile` file in the projects there you used the package:
122+
123+
```{r}
124+
java_env_unset()
125+
```
111126

112127
## Functions Overview
113128

vignettes/rJavaEnv-step-by-step.qmd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,19 @@ Using current session's JAVA_HOME: C:/Users/user_name/AppData/Local/Temp/75/Rtmp
305305
With the user-specified JAVA_HOME rJava and other rJava/Java-based packages will use Java version: "17.0.12"
306306
[1] TRUE
307307
```
308+
309+
### 6. Cleanup
310+
311+
If you do not want to use `rJavaEnv` anymore, please clear the cache folders before removing the package:
312+
313+
```{r}
314+
java_clear("project", delete_all = TRUE)
315+
java_clear("installed", delete_all = TRUE)
316+
java_clear("distrib", delete_all = TRUE)
317+
```
318+
319+
Also, clear the `.Rprofile` file in the projects there you used the package:
320+
321+
```{r}
322+
java_env_unset()
323+
```

vignettes/rJavaEnv.qmd

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ pkgdown:
1414
as_is: true
1515
---
1616

17-
This guide will walk you through downloading, installing, and managing `Java` environments for your R projects using the `rJavaEnv` package. We'll cover setting up the environment, un-setting it, managing distributions, installing `Java`, and checking `Java` versions.
1817

18+
This guide will walk you through downloading, installing, and managing `Java` environments for your R projects using the `rJavaEnv` package. We'll cover setting up the environment, un-setting it, managing distributions, installing `Java`, and checking `Java` versions. For more advanced use refer to the vignettes on [step-by-step fine-grained procedure to download, unpack, install and linke `Java`](rJavaEnv-step-by-step.qmd) and [vignette on using `rJavaEnv` with the `targets` and `callr` packages to manage multiple `Java` environments](multiple-java-with-targets-callr.qmd)
1919

2020
### 1. Quickly Download and Install Java
2121

@@ -142,7 +142,7 @@ Example expected output (on a Windows machine):
142142
Removed JAVA_HOME settings from .Rprofile in 'C:/Users/user_name/AppData/Local/Temp/75/RtmpuoG3xJ/.Rprofile'
143143
```
144144

145-
Now restart the current `R` session so that `R` picks up the system `Java` (or no `Java`, if it is not installed in the system).
145+
146146

147147
#### Delete `Java` from the project directory
148148

@@ -158,3 +158,24 @@ Example expected output:
158158
```
159159
All Java symlinks in the project have been cleared.
160160
```
161+
162+
Now restart the current `R` session so that `R` picks up the system `Java` (or no `Java`, if it is not installed in the system).
163+
164+
### 4. Complete Cleanup
165+
166+
If you do not want to use `rJavaEnv` anymore, please clear the cache folders before removing the package:
167+
168+
```{r}
169+
java_clear("project", delete_all = TRUE)
170+
java_clear("installed", delete_all = TRUE)
171+
java_clear("distrib", delete_all = TRUE)
172+
```
173+
174+
Also, clear the `.Rprofile` file in the projects there you used the package:
175+
176+
```{r}
177+
java_env_unset()
178+
```
179+
180+
181+
Now you can remove the package and restart the current `R` session so that `R` picks up the system `Java` (or no `Java`, if it is not installed in the system).

0 commit comments

Comments
 (0)