aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/docs/install.md
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-06-30 15:55:40 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-06-30 19:02:52 +0000
commit5d2d6bc15768a7346e8ea1a22bbe02626319a7d8 (patch)
treef65eb1845716fa54604925bb5529ac3cbdbb710e /site/docs/install.md
parentf598710fb9d2db8408264b2c16335330c44fee5d (diff)
Update install.md for Linux's java settings
Java settings requires to set JAVA_HOME but its is not required anymore on most case. Also the instruction themselves were confusing. Fixes #268 -- MOS_MIGRATED_REVID=97231074
Diffstat (limited to 'site/docs/install.md')
-rw-r--r--site/docs/install.md34
1 files changed, 15 insertions, 19 deletions
diff --git a/site/docs/install.md b/site/docs/install.md
index 4bcf3d04bd..cca725ba3e 100644
--- a/site/docs/install.md
+++ b/site/docs/install.md
@@ -38,18 +38,26 @@ To build Bazel on Ubuntu:
$ sudo apt-get install openjdk-7-jdk openjdk-7-source
```
-#### 2. Set the `JAVA_HOME` environment variable.
+#### 2. Install required packages:
-First, check to see if it's already set:
+```
+$ sudo apt-get install pkg-config zip g++ zlib1g-dev
+```
+
+#### 3. Build Bazel:
```
-$ echo $JAVA_HOME
+$ cd bazel
+$ ./compile.sh
```
-If this prints the path to the JDK 7 root directory, proceed to the next
-step. Otherwise, find the Java `bin` directory using `which javac` and use
-`javac -version` to verify that you have the right JDK version. Then set
-the `JAVA_HOME` environment variable to the `bin` directory parent.
+If this fails to find a correct Java version, then try to
+set the `JAVA_HOME` environment variable.
+
+Find the Java `bin` directory using `readlink -f $(which javac)`
+and use `javac -version` to verify that you have the right JDK version (1.7+).
+Then set the `JAVA_HOME` environment variable to the `bin` directory
+parent.
For example, if the path is `/usr/lib/jvm/jdk1.7.0/bin/javac`, set the
`JAVA_HOME` variable to `/usr/lib/jvm/jdk1.7.0`:
@@ -60,18 +68,6 @@ $ export JAVA_HOME=/usr/lib/jvm/jdk1.7.0
You can also add this line to your `~/.bashrc` file.
-#### 3. Install required packages:
-
-```
-$ sudo apt-get install pkg-config zip g++ zlib1g-dev
-```
-
-#### 4. Build Bazel:
-
-```
-$ cd bazel
-$ ./compile.sh
-```
### Building Bazel on OS X