189 <p>The Build Group has a wiki page with <a href="https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms">Supported Build Platforms</a>. From time to time, this is updated by the community to list successes or failures of building on different platforms.</p> |
189 <p>The Build Group has a wiki page with <a href="https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms">Supported Build Platforms</a>. From time to time, this is updated by the community to list successes or failures of building on different platforms.</p> |
190 <h3 id="windows">Windows</h3> |
190 <h3 id="windows">Windows</h3> |
191 <p>Windows XP is not a supported platform, but all newer Windows should be able to build OpenJDK.</p> |
191 <p>Windows XP is not a supported platform, but all newer Windows should be able to build OpenJDK.</p> |
192 <p>On Windows, it is important that you pay attention to the instructions in the <a href="#special-considerations">Special Considerations</a>.</p> |
192 <p>On Windows, it is important that you pay attention to the instructions in the <a href="#special-considerations">Special Considerations</a>.</p> |
193 <p>Windows is the only non-POSIX OS supported by OpenJDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. For OpenJDK 9, the only supported such layer is Cygwin. (Msys is no longer supported due to a too old bash; msys2 and the new Windows Subsystem for Linux (WSL) would likely be possible to support in a future version but that would require a community effort to implement.)</p> |
193 <p>Windows is the only non-POSIX OS supported by OpenJDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. For OpenJDK 9, the only supported such layer is Cygwin. (Msys is no longer supported due to a too old bash; msys2 and the new Windows Subsystem for Linux (WSL) would likely be possible to support in a future version but that would require a community effort to implement.)</p> |
194 <p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/hg/jdk9/Makefile</code> rather than <code>C:\hg\jdk9\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-freetype=/cygdrive/c/freetype</code> rather than <code>--with-freetype=c:\freetype</code>. For details on this conversion, see the section on <a href="#fixpath">Fixpath</a>.</p> |
194 <p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/hg/jdk9/Makefile</code> rather than <code>C:\hg\jdk9\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-msvcr-dll=/cygdrive/c/msvcr100.dll</code> rather than <code>--with-msvcr-dll=c:\msvcr100.dll</code>. For details on this conversion, see the section on <a href="#fixpath">Fixpath</a>.</p> |
195 <h4 id="cygwin">Cygwin</h4> |
195 <h4 id="cygwin">Cygwin</h4> |
196 <p>A functioning <a href="http://www.cygwin.com/">Cygwin</a> environment is thus required for building OpenJDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.</p> |
196 <p>A functioning <a href="http://www.cygwin.com/">Cygwin</a> environment is thus required for building OpenJDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.</p> |
197 <p><strong>Note:</strong> Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the OpenJDK build process, and that can cause unexpected build problems.</p> |
197 <p><strong>Note:</strong> Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the OpenJDK build process, and that can cause unexpected build problems.</p> |
198 <p>OpenJDK requires GNU Make 4.0 or greater on Windows. This is usually not a problem, since Cygwin currently only distributes GNU Make at a version above 4.0.</p> |
198 <p>OpenJDK requires GNU Make 4.0 or greater on Windows. This is usually not a problem, since Cygwin currently only distributes GNU Make at a version above 4.0.</p> |
199 <p>Apart from the basic Cygwin installation, the following packages must also be installed:</p> |
199 <p>Apart from the basic Cygwin installation, the following packages must also be installed:</p> |
370 <h2 id="external-library-requirements">External Library Requirements</h2> |
370 <h2 id="external-library-requirements">External Library Requirements</h2> |
371 <p>Different platforms require different external libraries. In general, libraries are not optional - that is, they are either required or not used.</p> |
371 <p>Different platforms require different external libraries. In general, libraries are not optional - that is, they are either required or not used.</p> |
372 <p>If a required library is not detected by <code>configure</code>, you need to provide the path to it. There are two forms of the <code>configure</code> arguments to point to an external library: <code>--with-<LIB>=<path></code> or <code>--with-<LIB>-include=<path to include> --with-<LIB>-lib=<path to lib></code>. The first variant is more concise, but require the include files an library files to reside in a default hierarchy under this directory. In most cases, it works fine.</p> |
372 <p>If a required library is not detected by <code>configure</code>, you need to provide the path to it. There are two forms of the <code>configure</code> arguments to point to an external library: <code>--with-<LIB>=<path></code> or <code>--with-<LIB>-include=<path to include> --with-<LIB>-lib=<path to lib></code>. The first variant is more concise, but require the include files an library files to reside in a default hierarchy under this directory. In most cases, it works fine.</p> |
373 <p>As a fallback, the second version allows you to point to the include directory and the lib directory separately.</p> |
373 <p>As a fallback, the second version allows you to point to the include directory and the lib directory separately.</p> |
374 <h3 id="freetype">FreeType</h3> |
374 <h3 id="freetype">FreeType</h3> |
375 <p>FreeType2 from <a href="http://www.freetype.org/">The FreeType Project</a> is required on all platforms. At least version 2.3 is required.</p> |
375 <p>FreeType2 from <a href="http://www.freetype.org/">The FreeType Project</a> is not required on any platform. The exception is on Unix-based platforms when configuring such that the build artifacts will reference a system installed library, rather than bundling OpenJDK's own copy.</p> |
376 <ul> |
376 <ul> |
377 <li>To install on an apt-based Linux, try running <code>sudo apt-get install libcups2-dev</code>.</li> |
377 <li>To install on an apt-based Linux, try running <code>sudo apt-get install libfreetype6-dev</code>.</li> |
378 <li>To install on an rpm-based Linux, try running <code>sudo yum install cups-devel</code>.</li> |
378 <li>To install on an rpm-based Linux, try running <code>sudo yum install freetype-devel</code>.</li> |
379 <li>To install on Solaris, try running <code>pkg install system/library/freetype-2</code>.</li> |
379 <li>To install on Solaris, try running <code>pkg install system/library/freetype-2</code>.</li> |
380 <li>To install on macOS, try running <code>brew install freetype</code>.</li> |
380 </ul> |
381 <li>To install on Windows, see <a href="#building-freetype-on-windows">below</a>.</li> |
381 <p>Use <code>--with-freetype-include=<path></code> and <code>--with-freetype-lib=<path></code> if <code>configure</code> does not automatically locate the platform FreeType files.</p> |
382 </ul> |
|
383 <p>Use <code>--with-freetype=<path></code> if <code>configure</code> does not properly locate your FreeType files.</p> |
|
384 <h4 id="building-freetype-on-windows">Building FreeType on Windows</h4> |
|
385 <p>On Windows, there is no readily available compiled version of FreeType. OpenJDK can help you compile FreeType from source. Download the FreeType sources and unpack them into an arbitrary directory:</p> |
|
386 <pre><code>wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz |
|
387 tar -xzf freetype-2.5.3.tar.gz</code></pre> |
|
388 <p>Then run <code>configure</code> with <code>--with-freetype-src=<freetype_src></code>. This will automatically build the freetype library into <code><freetype_src>/lib64</code> for 64-bit builds or into <code><freetype_src>/lib32</code> for 32-bit builds. Afterwards you can always use <code>--with-freetype-include=<freetype_src>/include</code> and <code>--with-freetype-lib=<freetype_src>/lib[32|64]</code> for other builds.</p> |
|
389 <p>Alternatively you can unpack the sources like this to use the default directory:</p> |
|
390 <pre><code>tar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz</code></pre> |
|
391 <h3 id="cups">CUPS</h3> |
382 <h3 id="cups">CUPS</h3> |
392 <p>CUPS, <a href="http://www.cups.org">Common UNIX Printing System</a> header files are required on all platforms, except Windows. Often these files are provided by your operating system.</p> |
383 <p>CUPS, <a href="http://www.cups.org">Common UNIX Printing System</a> header files are required on all platforms, except Windows. Often these files are provided by your operating system.</p> |
393 <ul> |
384 <ul> |
394 <li>To install on an apt-based Linux, try running <code>sudo apt-get install libcups2-dev</code>.</li> |
385 <li>To install on an apt-based Linux, try running <code>sudo apt-get install libcups2-dev</code>.</li> |
395 <li>To install on an rpm-based Linux, try running <code>sudo yum install cups-devel</code>.</li> |
386 <li>To install on an rpm-based Linux, try running <code>sudo yum install cups-devel</code>.</li> |