Mercurial > cgi-bin > hgweb.cgi > JpegWasher
comparison Building.html @ 33:3d86f0391168
Work on improving the build system.
author | David Barts <davidb@stashtea.com> |
---|---|
date | Fri, 24 Apr 2020 19:45:57 -0700 |
parents | |
children | 89d7f4d91f67 |
comparison
equal
deleted
inserted
replaced
32:c06edc56669b | 33:3d86f0391168 |
---|---|
1 <!DOCTYPE html> | |
2 <!-- Skeleton or template web page, in the standard style. --> | |
3 <html> | |
4 <head> | |
5 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
6 <title>Building JpegWasher</title> | |
7 <style> | |
8 html { font-family: "TeX Gyre Schola", serif; } | |
9 h1, h2, h3, h4, h5, h6 { font-family: "Avenir Next", sans-serif; } | |
10 pre, code, kbd, samp { font-family: "Menlo", monospace; ; font-size: 85%; } | |
11 </style> | |
12 </head> | |
13 <body> | |
14 <h1>Building JpegWasher</h1> | |
15 <h2>Prerequisites</h2> | |
16 <ul> | |
17 <li><a href="https://ant.apache.org/">Apache Ant</a>, with the following | |
18 extensions (note that the extensions are already present in the lib | |
19 subdirectory, but you will need to install Ant).</li> | |
20 <ul> | |
21 <li><a href="http://ant-contrib.sourceforge.net/">Ant-Contrib</a></li> | |
22 <li><a href="https://github.com/UltraMixer/JarBundler">JarBundler</a> | |
23 (if building on a Mac)</li> | |
24 <li><a href="http://launch4j.sourceforge.net/">launch4j</a> (if building | |
25 on Windows)</li> | |
26 </ul> | |
27 <li>Java JDK 1.8 or better (see notes).</li> | |
28 <li>Kotlin</li> | |
29 <li>Exiv2</li> | |
30 <li>A C++ Compiler</li> | |
31 <li>Make (Nmake on Windows)</li> | |
32 </ul> | |
33 <h2>JpegWasher Is Not Pure Java</h2> | |
34 <p>This means two things: </p> | |
35 <ol> | |
36 <li>You need a C++ compiler in addition to a Kotlin compiler (and a Java | |
37 one) to build JpegWasher.</li> | |
38 <li>The result of a build will run only on the architecture you built it | |
39 on.</li> | |
40 </ol> | |
41 <p>It <em>is</em> possible to create a semi-portable JAR that runs on both | |
42 Linux and Windows (it contains both <code>*.so</code> libraries and <code>*.dll</code> | |
43 ones, and loads the correct ones at run time, see <code>linwin.jar</code>), | |
44 but the process for doing so is not totally automated. It is alas not | |
45 possible to support the Macintosh in the same JAR as well, because a Mac | |
46 app in Java 1.8 requires making a few nonportable, Apple-only API calls, | |
47 whose presence will cause <code>ClassNotFoundException</code> to be | |
48 thrown at runtime on non-Macintosh systems.</p> | |
49 <p>As to why, the answer is simple: Try as I could, I could not find any | |
50 pure Java libraries that could read <em>and write</em> image metadata. | |
51 Therefore I had to use a C++ library.</p> | |
52 <h2>Which Version of Java to Use?</h2> | |
53 <p>In short, Java 1.8. Most systems don't yet have OpenJDK 11 or greater | |
54 installed, so using a compiler newer than 1.8 is asking for trouble. All | |
55 code <em>should</em> build on OpenJDK 11 or greater, with the exception | |
56 of the OS-dependent code for the Macintosh (which will have to be recoded | |
57 to use the <code>java.awt.Desktop</code> class). The latter would be a | |
58 net win, as it is portable, and would spell the death of the only bit of | |
59 OS-dependent Kotlin code in this application.</p> | |
60 <p>In another year or two, I will probably make OpenJDK 11 or greater the | |
61 preferred version.</p> | |
62 </body> | |
63 </html> |