Skip to content

Commit 2b370f3

Browse files
committed
Add detailed instructions for building on Windows
Adding the detailed build instructions for creating an OpenjDK V9 with OpenJ9 binary for Windows. Created as a completely separate section in the existing build instructions. No attempt to merge instructions for platforms yet. [ci skip] Work supports issue at ibmruntimes/openj9-openjdk-jdk9#18 Issue eclipse-openj9#18 Signed-off-by: Sue Chaplain <[email protected]>
1 parent 3bbc78d commit 2b370f3

File tree

1 file changed

+96
-2
lines changed

1 file changed

+96
-2
lines changed

buildenv/Build_Instructions_V9.md

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,102 @@ OpenJDK - 437530c based on jdk-9+181)
302302
## Windows
303303
:ledger:
304304

305-
:construction:
306-
We haven't created a full build process for Windows yet? Watch this space!
305+
The following instructions guide you through the process of building a Windows OpenJDK V9 binary that contains Eclipse OpenJ9. This process can be used to build binaries for Windows 7, 8, and 10.
306+
307+
### 1. Prepare your system
308+
:ledger:
309+
You must install a number of software dependencies to create a suitable build environment on your system:
310+
311+
- [Cygwin](https://cygwin.com/install.html), which provides a Unix-style command line interface. Install all packages in the `Devel` category. In the `Archive` category, install the packages `zip` and `unzip`. Install any further package dependencies that are identified by the installer. More information about using Cygwin can be found [here](https://cygwin.com/docs.html).
312+
- [Windows JDK 8](https://adoptopenjdk.net/releases.html#x64_win), which is used as the boot JDK.
313+
- [Microsoft Visual Studio 2013]( https://go.microsoft.com/fwlink/?LinkId=532495), which is the same compiler level used by OpenJDK. Later levels of this compiler are not supported.
314+
- [Freemarker V2.3.8](https://sourceforge.net/projects/freemarker/files/freemarker/2.3.8/freemarker-2.3.8.tar.gz/download)
315+
- [Freetype2 V2.3](https://www.freetype.org/download.html)
316+
317+
318+
You can download Visual Studio, Freemarker, and Freetype manually or obtain them using the [wget](http://www.gnu.org/software/wget/faq.html#download) utility. If you choose to use `wget`, follow these steps:
319+
320+
- Open a cygwin terminal and change to the `/temp` directory:
321+
```
322+
cd /cygdrive/c/temp
323+
```
324+
325+
- Run the following commands:
326+
```
327+
wget https://go.microsoft.com/fwlink/?LinkId=532495 -O vs2013.exe
328+
wget https://sourceforge.net/projects/freemarker/files/freemarker/2.3.8/freemarker-2.3.8.tar.gz/download -O freemarker.tgz
329+
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
330+
```
331+
- Before installing Visual Studio, change the permissions on the installation file by running `chmod u+x vs2013.exe`.
332+
- Install Visual Studio by running the file `vs2013.exe`.
333+
334+
- To unpack the Freemarker and Freetype compressed files, run:
335+
```
336+
tar -xzf freemarker.tgz freemarker-2.3.8/lib/freemarker.jar --strip=2
337+
tar --one-top-level=/cygdrive/c/temp/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz
338+
```
339+
340+
### 2. Get the source
341+
:ledger:
342+
First you need to clone the Extensions for OpenJDK for OpenJ9 project. This repository is a git mirror of OpenJDK without the HotSpot JVM, but with an **openj9** branch that contains a few necessary patches.
343+
344+
Run the following command in the Cygwin terminal:
345+
```
346+
git clone https://github.com/ibmruntimes/openj9-openjdk-jdk9
347+
```
348+
Cloning this repository can take a while because OpenJDK is a large project! When the process is complete, change directory into the cloned repository:
349+
```
350+
cd openj9-openjdk-jdk9
351+
```
352+
Now fetch additional sources from the Eclipse OpenJ9 project and its clone of Eclipse OMR:
353+
354+
```
355+
bash ./get_source.sh
356+
```
357+
### 3. Configure
358+
:ledger:
359+
When you have all the source files that you need, run the configure script, which detects how to build in the current build environment.
360+
```
361+
bash configure --disable-warnings-as-errors --with-toolchain-version=2013 --with-freemarker-jar=/cygdrive/c/temp/freemarker.jar --with-freetype-src=/cygdrive/c/temp/freetype
362+
```
363+
364+
:pencil: Modify the paths for freemarker and freetype if you manually downloaded and unpacked these dependencies into different directories. If Java 8 is not available on the path, add the `--with-boot-jdk=<path_to_jdk8>` configuration option.
365+
366+
### 4. build
367+
:ledger:
368+
Now you're ready to build OpenJDK with OpenJ9:
369+
```
370+
make all
371+
```
372+
373+
Two Java builds are produced: a full developer kit (jdk) and a runtime environment (jre)
374+
- **build/windows-x86_64-normal-server-release/images/jdk**
375+
- **build/windows-x86_64-normal-server-release/images/jre**
376+
377+
### 5. Test
378+
:ledger:
379+
For a simple test, try running the `java -version` command.
380+
Change to the /jdk directory:
381+
```
382+
cd build/windows-x86_64-normal-server-release/images/jdk
383+
```
384+
Run:
385+
```
386+
./bin/java -version
387+
```
388+
389+
Here is some sample output:
390+
391+
```
392+
openjdk version "9-internal"
393+
OpenJDK Runtime Environment (build 9-internal+0-adhoc.Administrator.openj9-openjdk-jdk9)
394+
Eclipse OpenJ9 VM (build 2.9, JRE 9 Windows 8.1 amd64-64 Compressed References 20171031_000000 (JIT enabled, AOT enabled)
395+
OpenJ9 - 68d6fdb
396+
OMR - 7c3d3d72
397+
OpenJDK - 198304337b based on jdk-9+181)
398+
```
399+
400+
:ledger: *Congratulations!* :tada:
307401

308402
----------------------------------
309403

0 commit comments

Comments
 (0)