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