[981dbbc] | 1 | Creating an OpenJDK (and OpenJRE) package for Slackware |
---|
| 2 | ======================================================= |
---|
| 3 | |
---|
| 4 | In this directory you will find everything I used to create packages |
---|
| 5 | for OpenJDK's JRE and JDK as an alternative to Oracle's binary-only releases |
---|
| 6 | of Java. Oracle no longer allows these binaries to be included with OS |
---|
| 7 | distributions, so Slackware will no longer provide updates for them. |
---|
| 8 | Build instructions for OpenJDK are provided further down in this README. |
---|
| 9 | |
---|
| 10 | Or, you can just install my pre-compiled packages which I *also* provide! |
---|
| 11 | |
---|
| 12 | If you want to install and just use my pre-built packages, then all you |
---|
| 13 | really need is "icedtea-web" which is the browser plugin, and one of |
---|
| 14 | the "openjdk" or "openjre" packages, depending of course on whether you |
---|
| 15 | need the full Java compiler suite or only the Java Runtime Environment. |
---|
| 16 | A separate "rhino" package is no longer needed because Java 8 contains |
---|
| 17 | its own JavaScript engine implementation now. |
---|
| 18 | |
---|
| 19 | You will also need to install apache-ant if you want to compile OpenJDK |
---|
| 20 | yourself. In the past, xalan and xerces were needed separately as well |
---|
| 21 | but that is no longer needed since apache-ant 1.8.1 and newer has a |
---|
| 22 | fixed 'ant -diagnostics' command when xerces+xalan are not present. |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | Compiling OpenJDK from source |
---|
| 26 | ============================= |
---|
| 27 | |
---|
| 28 | Compiling OpenJDK can be done in two ways. The first way is called |
---|
| 29 | "bootstrapping", which means compiling OpenJDK when there is no version of |
---|
| 30 | the OpenJDK installed yet. The SlackBuild uses the gcc java compiler for this |
---|
| 31 | bootstrap (which means you have to have the "gcc-java" package installed). |
---|
| 32 | The second way is to compile OpenJDK using an already installed version of |
---|
| 33 | OpenJDK. Such a pre-installed OpenJDK must have the same version (meaning, |
---|
| 34 | OpenJDK 8 can only be compiled by another OpenJDK 8) and must have been |
---|
| 35 | created with the help of "IcedTea" like my own openjdk,SlackBuild does. |
---|
| 36 | |
---|
| 37 | The variable "BOOTSTRAP" inside the openjdk.SlackBuild determines which java |
---|
| 38 | compiler will be used to compile OpenJDK. If you want to use gcc's java, then |
---|
| 39 | the command will be: |
---|
| 40 | |
---|
| 41 | # BOOTSTRAP=YES ./openjdk.SlackBuild |
---|
| 42 | |
---|
| 43 | If you already have OpenJDK installed then you would start the compilation with: |
---|
| 44 | |
---|
| 45 | # BOOTSTRAP=NO ./openjdk.SlackBuild |
---|
| 46 | |
---|
| 47 | By default, the variable in the script is set to "NO" which means that if |
---|
| 48 | you run the openjdk.SlackBuild script without any parameters, it will use |
---|
| 49 | a pre-esisting OpenJDK to compile the new package. |
---|
| 50 | |
---|
| 51 | This SlackBuild script creates _two_ packages, the "openjdk" and the "openjre". |
---|
| 52 | If you only need a Java Runtime then all you should install is the openjre |
---|
| 53 | package - it is much smaller than the openjdk package. The "openjdk" package |
---|
| 54 | contains the Java compiler and SDK. |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | Java Web Plugin for OpenJDK |
---|
| 58 | =========================== |
---|
| 59 | |
---|
| 60 | Suns's binary distribution of Java (taken over by Oracle) contains a Java web |
---|
| 61 | plugin for mozilla-compatible browsers. This plugin was not open sourced, |
---|
| 62 | so OpenJDK needs a different solution in order to provide a web plugin for Java. |
---|
| 63 | To this purpose, you have to (build and) install the "icedtea-web" package. |
---|
| 64 | First compile and install OpenJDK (you need the openjdk package for this, not |
---|
| 65 | the JRE), then compile icedtea-web. The SlackBuild script plus sources are |
---|
| 66 | in a separate directory. Note that the icedtea-web plugin is not as mature |
---|
| 67 | as the plugin which is shipped with Oracle's binaries. |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | Build-time requirements for OpenJDK and icedtea-web |
---|
| 71 | =================================================== |
---|
| 72 | |
---|
| 73 | Slackware 14.0 and newer: |
---|
| 74 | ------------------------- |
---|
| 75 | The gcc and seamonkey packages shipped with the distro can be used unmodified. |
---|
| 76 | |
---|
| 77 | A word of caution. All stable Slackware versions before "14.0" are |
---|
| 78 | not able to compile OpenJDK "out of the box". You have to enhance two core |
---|
| 79 | packages: "gcc" and "seamonkey" so that they become capable of compiling |
---|
| 80 | OpenJDK. Use the following instructions to fix-up gcc and seamonkey. |
---|
| 81 | Either alternative is OK but running the shell scripts (the "b" options) |
---|
| 82 | is a *lot* faster than recompiling these big packages. These core Slackware |
---|
| 83 | packages have be fixed in slackware-current. |
---|
| 84 | |
---|
| 85 | Slackware 13.37: |
---|
| 86 | ---------------- |
---|
| 87 | You need to upgrade to the seamonkey* packages in the ./patches directory. |
---|
| 88 | Choose one of these two alternatives to get a compatible gcc-java compiler: |
---|
| 89 | a) rebuild gcc with "--enable-java-home". You can use the gcc.SlackBuild |
---|
| 90 | of Slackware-current which was modified accordingly. |
---|
| 91 | b) or run the script "create_gcj_jvm.sh" to achieve the same result you |
---|
| 92 | would get by rebuilding gcc: which is to create a directory structure |
---|
| 93 | of symlinks, which emulates the presence of a Sun JDK but for the |
---|
| 94 | GCC Java compiler. |
---|
| 95 | |
---|
| 96 | Slackware 13.1 and older: |
---|
| 97 | ------------------------- |
---|
| 98 | 1) Choose one of these two alternatives for gcc: |
---|
| 99 | a) rebuild gcc with "--enable-java-home". You can use the gcc.SlackBuild |
---|
| 100 | of Slackware-current which was modified accordingly. |
---|
| 101 | b) or run the script "create_gcj_jvm.sh" to achieve the same result you |
---|
| 102 | would get by rebuilding gcc: which is to create a directory structure |
---|
| 103 | of symlinks, which emulates the presence of a Sun JDK but for the |
---|
| 104 | GCC Java compiler. |
---|
| 105 | 2) Choose one of these two alternatives for seamonkey: |
---|
| 106 | a) rebuild seamonkey using the seamonkey.SlackBuild of Slackware-current |
---|
| 107 | which was modified accordingly. |
---|
| 108 | b) or run the script "fix_seamonkey_pkgconfig.sh" which does two things: |
---|
| 109 | add a pkgconfig file "libxul.pc" and modify an existing pkgconfig |
---|
| 110 | file, "seamonkey-plugin.pc" |
---|
| 111 | |
---|
| 112 | Furthermore, you will need to have the following Apache Ant related packages |
---|
| 113 | installed before starting the compilation of OpenJDK. |
---|
| 114 | * apache-ant |
---|
| 115 | |
---|
| 116 | Please note that after installing apache-ant you will have to logout and |
---|
| 117 | login again to initialize the ANT_HOME environment variable. |
---|
| 118 | |
---|
| 119 | Apache-ant is only needed during the compilation and can optionally be removed |
---|
| 120 | afterwards (but why should you). |
---|
| 121 | |
---|
| 122 | |
---|
| 123 | ============================================================================== |
---|
| 124 | Eric Hameleers <alien at slackware.com>, 24-apr-2016 |
---|