aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/docs/install.md
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2015-04-02 21:43:30 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-04-03 20:36:46 +0000
commitd6cd5b2d4b45d9489fec0dd04c4bff7d2e2dad67 (patch)
treed7859784736e0acbf920b7f51de435a46d5e5edd /site/docs/install.md
parent6c8b0b6785d9907be81b300e1bde45f086d67b39 (diff)
Markdown fixes and light editing of Installing Bazel page:
- Uses GitHub-style fencing instead of indentation for code blocks - Adds double-= line breaks for paragraph-style list items - Changes some text for readability -- MOS_MIGRATED_REVID=90198077
Diffstat (limited to 'site/docs/install.md')
-rw-r--r--site/docs/install.md168
1 files changed, 98 insertions, 70 deletions
diff --git a/site/docs/install.md b/site/docs/install.md
index 63ed100d1d..ac93ad5cc5 100644
--- a/site/docs/install.md
+++ b/site/docs/install.md
@@ -4,25 +4,25 @@ layout: default
# Installing Bazel
-This file contains instructions for downloading, building and running Bazel.
-
## System Requirements
Supported platforms:
-* Ubuntu Linux
-* Mac OS X
+* Ubuntu Linux
+* Mac OS X
Java:
-* Java JDK 8 or later
+* Java JDK 8 or later
-## Getting Bazel
+## Downloading Bazel
-1. Clone the Bazel repo from GitHub:
+Clone the Bazel repo from GitHub:
- $ cd $HOME
- $ git clone https://github.com/google/bazel/
+```
+$ cd $HOME
+$ git clone https://github.com/google/bazel/
+```
## Building Bazel
@@ -30,106 +30,134 @@ Java:
To build Bazel on Ubuntu:
-1. Install JDK 8:
- * Ubuntu Trusty (14.04LTS): OpenJDK 8 is not available so the
- fastest way is to install the Oracle JDK 8:
+1. Install JDK 8:
- $ sudo add-apt-repository ppa:webupd8team/java
- $ sudo apt-get update
- $ sudo apt-get install oracle-java8-installer
- * Ubuntu Utopic (14.10): you can install OpenJDK 8 like this:
+ * **Ubuntu Trusty (14.04 LTS).** OpenJDK 8 is not available on Trusty. To
+ install Oracle JDK 8:
- $ sudo apt-get install openjdk-8-jdk
+ ```
+ $ sudo add-apt-repository ppa:webupd8team/java
+ $ sudo apt-get update
+ $ sudo apt-get install oracle-java8-installer
+ ```
-2. Set the `JAVA_HOME` environment variable.
+ * **Ubuntu Utopic (14.10).** To install OpenJDK 8:
- Check if it's already set:
+ ```
+ $ sudo apt-get install openjdk-8-jdk
+ ```
- $ echo $JAVA_HOME
+2. Set the `JAVA_HOME` environment variable.
- If this prints the path to the JDK 8 root, you can proceed to the next step.
+ First, check to see if it's already set:
- Otherwise you'll need to set this to the root of the JDK. Use `which javac`
- to find the path to the JDK's `bin` directory. Use `javac -version` to verify
- that you're dealing with the right JDK version.
+ ```
+ $ echo $JAVA_HOME
+ ```
- For example the path could be `/usr/lib/jvm/jdk1.8.0/bin/javac`. Set the
- `JAVA_HOME` variable to `/usr/lib/jvm/jdk1.8.0` then, using:
+ If this prints the path to the JDK 8 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.
- $ export JAVA_HOME=/usr/lib/jvm/jdk1.8.0
+ For example, if the path is `/usr/lib/jvm/jdk1.8.0/bin/javac`, set the
+ `JAVA_HOME` variable to `/usr/lib/jvm/jdk1.8.0`:
- You can also add this line to your `~/.bashrc` file.
+ ```
+ $ export JAVA_HOME=/usr/lib/jvm/jdk1.8.0
+ ```
-3. Install required packages:
+ You can also add this line to your `~/.bashrc` file.
- $ sudo apt-get install libarchive-dev pkg-config zip g++ zlib1g-dev
+3. Install required packages:
-4. Build Bazel:
+ ```
+ $ sudo apt-get install libarchive-dev pkg-config zip g++ zlib1g-dev
+ ```
- $ cd bazel
- $ ./compile.sh
+4. Build Bazel:
+ ```
+ $ cd bazel
+ $ ./compile.sh
+ ```
### Building Bazel on OS X
-Using Bazel on Mac OS X requires:
+Bazel on Mac OS X requires:
-* The Xcode command line tools. Xcode can be downloaded from
- [Apple's developer site](https://developer.apple.com/xcode/downloads/).
-* MacPorts or Homebrew for installing required packages.
-* An installation of JDK 8.
-* (optional) For `objc_*` and `ios_*` rule support: An installed copy of
- Xcode 6.1 or later with iOS SDK 8.1.
+* The Xcode command line tools. Xcode can be downloaded from the
+ [Apple Developer Site](https://developer.apple.com/xcode/downloads/).
-To build Bazel on Mac OS X:
+* MacPorts or Homebrew for installing required packages.
+
+* An installation of JDK 8.
+* For `objc_*` and `ios_*` rule support, you must have Xcode 6.1 or later with
+ iOS SDK 8.1 installed on your system.
+
+To build Bazel on Mac OS X:
-1. Install required packages:
+1. Install the required packages:
- $ port install protobuf-cpp libarchive
+ ```
+ $ port install protobuf-cpp libarchive
+ ```
- or
+ or
- $ brew install protobuf libarchive
+ ```
+ $ brew install protobuf libarchive
+ ```
2. Build Bazel:
- $ cd bazel
- $ ./compile.sh
+ ```
+ $ cd bazel
+ $ ./compile.sh
+ ```
-3. Run it
+3. Run Bazel:
- $ ./output/bazel help
+ ```
+ $ ./output/bazel help
+ ```
## Running Bazel
+The Bazel executable is located at `output/bazel` in the Bazel home directory.
+It's a good idea to add this path to your default paths, as follows:
-The Bazel executable is located at `output/bazel` in the bazel directory.
-It's a good idea to add this path to your default paths, like so (you
-can also add this command to your `~/.bashrc`):
+```
+$ export PATH="$PATH:$HOME/bazel/output/bazel"
+```
- $ export PATH="$PATH:$HOME/bazel/output"
+You can also add this command to your `~/.bashrc` file.
-You must run Bazel from within a source code tree that is properly
-configured for use with Bazel. We call such a tree a _workspace
-directory_. Bazel provides a default workspace directory with sample
-`BUILD` files and source code in `base_workspace`. The default
-workspace contains files and directories that must be present in order
-for Bazel to work. If you want to build from source outside the
-default workspace directory, copy the entire `base_workspace`
-directory to the new location before adding your `BUILD` and source
-files.
+You must run the Bazel from within a directory that is properly configured for
+use with the application. We call this directory a _workspace directory_.
+Bazel provides a default workspace directory with sample `BUILD` files and
+source code at `base_workspace` in the Bazel home directory. This directory
+contains files and subdirectories that must be present in order for Bazel to
+work. If you want to build from source outside the default workspace directory,
+copy the entire `base_workspace` directory to the new location before adding
+your `BUILD` and source files.
-Build a sample Java application:
+To run Bazel and build a sample Java application:
- $ cp -R $HOME/bazel/base_workspace $HOME/my_workspace
- $ cd $HOME/my_workspace
- $ bazel build //examples/java-native/src/main/java/com/example/myproject:hello-world
+```
+$ cp -R $HOME/bazel/base_workspace $HOME/my_workspace
+$ cd $HOME/my_workspace
+$ bazel build //examples/java-native/src/main/java/com/example/myproject:hello-world
+```
-The build output is located in `$HOME/my_workspace/bazel-bin/examples/java-native/src/main/java/com/example/myproject/`.
+The build output is located in
+`$HOME/my_workspace/bazel-bin/examples/java-native/src/main/java/com/example/myproject/`.
-Run the sample application:
+To run the sample application:
- $ $HOME/my_workspace/bazel-bin/examples/java-native/src/main/java/com/example/myproject/hello-world
+```
+$ $HOME/my_workspace/bazel-bin/examples/java-native/src/main/java/com/example/myproject/hello-world
+```
-For more information, see [Getting started](getting-started.html).
+For more information, see [Getting started](getting-started.md).