Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dougxc committed Aug 10, 2018
1 parent ad8d7fb commit d847986
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
22 changes: 12 additions & 10 deletions compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,28 @@ git clone https://github.com/graalvm/mx.git
export PATH=$PWD/mx:$PATH
```

Graal depends on a JDK that supports a compatible version of JVMCI ([JVM Compiler Interface](https://bugs.openjdk.java.net/browse/JDK-8062493)). There is a JVMCI
[port](https://github.com/graalvm/graal-jvmci-8) for JDK 8 and the required JVMCI version is built into the JDK as of JDK 11-ea+20.
Graal depends on a JDK that supports a compatible version of JVMCI ([JVM Compiler Interface](https://bugs.openjdk.java.net/browse/JDK-8062493)).
There is a JVMCI [port](https://github.com/graalvm/graal-jvmci-8) for JDK 8 and the required JVMCI version is built into the JDK as of JDK 11.
To develop Graal you need either a JVMCI-enabled JDK 8 (download from [OTN](http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html) or [build](#building-jvmci-jdk8) yourself)
or JDK 11 (build 20 or later).

Graal currently requires a JVMCI-enabled JDK 8 (download from [OTN](http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html) or [build](#building-jvmci-jdk8) yourself) and will do so until all JDK 8 specific Graal code is factored out as [versioned sources](https://github.com/graalvm/mx#versioning-sources-for-different-jdk-releases).
Developing versioned sources specific to other JDKs requires them to be made
available on the `EXTRA_JAVA_HOMES` environment variable. At the time of writing, this
JDK 11-ea+20 ([early access build](http://jdk.java.net/11/) should work but a build from
the [latest bits](http://hg.openjdk.java.net/jdk/jdk/) is required if Graal targets features not yet in an early access build).
Most Graal sources are compliant with Java 8. Some sources use API specific to JDK 8 or only introduced in JDK 9.
These sources are in [versioned projects](https://github.com/graalvm/mx#versioning-sources-for-different-jdk-releases).
If you don't have a JDK that satisfies the requirement of a versioned project, the project is ignored by mx.
You specify the JDK(s) available to mx with the `JAVA_HOME` and `EXTRA_JAVA_HOMES` environment variables.

Here is a typical set up for specifying multiple JDKs on Linux:
```
export JAVA_HOME=/usr/lib/jvm/labsjdk1.8.0_172-jvmci-0.44
export JAVA_HOME=/usr/lib/jvm/labsjdk1.8.0_172-jvmci-0.46
export EXTRA_JAVA_HOMES=/usr/lib/jvm/jdk-11
```
And on macOS:
```
export JAVA_HOME=/Library/Java/JavaVirtualMachines/labsjdk1.8.0_172-jvmci-0.44/Contents/Home
export JAVA_HOME=/Library/Java/JavaVirtualMachines/labsjdk1.8.0_172-jvmci-0.46/Contents/Home
export EXTRA_JAVA_HOMES=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
```
If you omit `EXTRA_JAVA_HOMES`, the associated sources will not be built. Note that `JAVA_HOME` defines the *primary* JDK for development. For instance, when running `mx vm`, this is the JDK that will be used so if you want to run on JDK 11, swap JDK 8 and JDK 11 in `JAVA_HOME` and `EXTRA_JAVA_HOMES`.
If you omit `EXTRA_JAVA_HOMES` in the above examples, versioned projects depending on JDK 9 or later will be ignored.
Note that `JAVA_HOME` defines the *primary* JDK for development. For instance, when running `mx vm`, this is the JDK that will be used so if you want to run on JDK 11, swap JDK 8 and JDK 11 in `JAVA_HOME` and `EXTRA_JAVA_HOMES`.

Now change to the `graal/compiler` directory:

Expand Down
9 changes: 5 additions & 4 deletions compiler/docs/IDEs.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To make IntelliJ work the same way as Eclipse with respect to Problems View and
### Eclipse
This section describes how to set up Eclipse for Graal development. For convenience, `$GRAAL` denotes your local Graal repository.

Eclipse can be downloaded [here](http://download.eclipse.org/eclipse/downloads/). The currently recommended version for Graal development is 4.7.3a.
Eclipse can be downloaded [here](http://download.eclipse.org/eclipse/downloads/). The currently recommended version for Graal development is 4.7.3a ("Oxygen").

Once you have installed Eclipse, if you have multiple Java versions on your computer, you should edit [eclipse.ini](http://wiki.eclipse.org/Eclipse.ini) to [specify the JVM](http://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM) that Eclipse will be run with. It must be run with a JDK 9 or later VM. For example:
```
Expand All @@ -49,11 +49,12 @@ Once you have installed Eclipse, if you have multiple Java versions on your comp

When first launching Eclipse, you should create a new workspace for Graal development. Select the parent of `$GRAAL` as the workspace as you will also be importing projects from the suites that Graal depends on.

The configurations created by the `mx eclipseinit` command binds projects to Execution Environments corresponding to the Java compliance level of the projects. You need to configure these Execution Environments as follows:
The configurations created by the `mx eclipseinit` command binds projects to Execution Environments or JREs corresponding to the Java compliance level of the projects. You need to configure these Execution Environments and JREs as follows:

1. From the main menu bar, select **Window > Preferences**.
2. On the left, select **Java > Installed JREs > Execution Environments**
3. Configure the **JavaSE-1.8**, **JavaSE-9**, **JavaSE-10** etc environments. You may need to first add any missing JREs.
2. On the left, select **Java > Installed JREs**
3. Ensure there is an installed JRE with the name `jdk-11`.
4. Select **Execution Environments** and configure the **JavaSE-1.8** environment.
4. Click **OK**

Run `mx eclipseinit` to create the Eclipse project configurations for all the Java projects then use the **Import Wizard** to import the created/updated projects:
Expand Down

0 comments on commit d847986

Please sign in to comment.