docs: update Windows installation and setup docs
Also update the Java Tutorial page to say you have
to install the JDK and set JAVA_HOME.
See https://github.com/bazelbuild/bazel/issues/5208
Change-Id: I14b792589c39f03572518aaff6f6f8e5ca8a65c8
Closes #5617.
Change-Id: I45c841189b0c220365ab9aeeb67f26b32059be4a
PiperOrigin-RevId: 206156529
diff --git a/site/docs/tutorial/java.md b/site/docs/tutorial/java.md
index 8352229..b1ed79d 100644
--- a/site/docs/tutorial/java.md
+++ b/site/docs/tutorial/java.md
@@ -27,6 +27,7 @@
* [Before you begin](#before-you-begin)
* [Install Bazel](#install-bazel)
+ * [Install the JDK](#install-the-jdk)
* [Get the sample project](#get-the-sample-project)
* [Build with Bazel](#build-with-bazel)
* [Set up the workspace](#set-up-the-workspace)
@@ -47,6 +48,23 @@
To prepare for the tutorial, first [Install Bazel](../install.md) if
you don't have it installed already.
+### Install the JDK
+
+1. Install Java 8 JDK.
+
+2. Set the JAVA\_HOME environment variable to point to the JDK.
+ * On Linux/macOS:
+
+ export JAVA_HOME="$(dirname $(dirname $(realpath $(which javac))))"
+ * On Windows:
+ 1. Open Control Panel.
+ 2. Go to "System and Security" > "System" > "Advanced System Settings" > "Advanced" tab > "Environment Variables..." .
+ 3. Under the "User variables" list (the one on the top), click "New...".
+ 4. In the "Variable name" field, enter `JAVA_HOME`.
+ 5. Click "Browse Directory...".
+ 6. Navigate to the JDK directory (for example `C:\Program Files\Java\jdk1.8.0_152`).
+ 7. Click "OK" on all dialog windows.
+
### Get the sample project
Retrieve the sample project from Bazel's GitHub repository:
@@ -60,7 +78,6 @@
```
java-tutorial
-│
├── BUILD
├── src
│ └── main