Skip to content

Guide on building OpenJDK for Zinc Native

lockieluke edited this page Jan 4, 2021 · 2 revisions

Guide on building OpenJDK for Zinc Native

Zinc Native is a module that helps Zinc to operate performance-intensive tasks and to support multithreading since NodeJS doesn't support multithreading. However, Zinc Native is written Java so it needs OpenJDK to run. Using the OpenJDK that is available to download on the Internet is too big and heavy for Zinc Native although you can use it if you don't mind the problem of size.

Build prerequisites

  • OpenJDK 15(recommended) installed and is added to PATH
  • NodeJS (It is required for developing Zinc although it is not used in this guide)

How to build

  1. Navigate to any directory e.g. Desktop

    cd Desktop
  2. Build OpenJDK 15 into java-runtime folder (Actually the name doesn't matter)

    jlink --verbose --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules="jdk.unsupported,java.sql,java.desktop,java.naming,java.management,java.instrument,java.security.jgss" --output="./java-runtime"
  3. Move the bin and lib folder into a new folder named java under Zinc's project directory which should looks like this

    Zinc
    -...
    -java
     -bin
     -lib
    -...
    
Clone this wiki locally