123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <HTML>
- <BODY>
- <h1> Overview </h1>
- JACOB is built on windows machines using ANT, most commonly from inside of Eclipse. The main steps for getting a working
- Jacob build are:
- <ol>
- <li>Check out the source code or unpack the source zip file from sourceforge</li>
- <li>Install the Development Environment</li>
- <li>Configure the build by creating a
- <i>compilation_tools.properties</i> file.</li>
- <li>Run Eclipse and load the project into eclipse</li>
- <li>Open the build.xml file in Eclipse and run the default ant target </li>
- </ol>
- <h1> Repository Organization </h1>
- Unpack the source archive zip file or check the files out of CVS into d:\jacob or some other familiar place. Source Java
- and JNI files are located in separate packages from the unit tests and the samples.
- <ul>
- <li>docs: documentation</li>
- <li>jni: c++ code</li>
- <li>lib: libraries needed to compile unit tests</li>
- <li>release: a directory built by the ant script where jacob is constructed</li>
- <li>samples: sample programs</li>
- <li>src: Jacob Java source files</li>
- <li>unittest: JUnit 4.12 unit test programs. Run from the test target in build.xml</li>
- <li>vstudio: some out of date VC++ project files</li>
- <li>bulid.xml: the ant build script. It can be run from inside Eclipse</li>
- </ul>
- The Servlet examples that required j2ee libraries to compile have temporarily been removed.
- <H1>Development Environment</h1>
- The simplest build environment includes MS Visual Studio 13.0 (Studio 2013), Eclipse 4.7 with the C/C++ module and JDK 1.8.
- In that situation, you would just create the
- <i>compilation_tools.properties</i>
- using the example at the top of build.xml as a template.
- <UL>
- <li> Microsoft Visual Studio 2013 and it's included library. (to C:\ProgramFiles (X86) in my case)</li>
- <li> Eclipse from www.eclipse.org as the Java IDE.</li>
- <li> Eclipse C/C++ plugin can be used for C coding in place of VC++ IDE.</li>
- <li> Java JDK 1.8 , latest available</li>
- <li> Install the V7.1A libraries available from https://www.microsoft.com/net/download/windows</li>
- </ul>
- <p></p>
- <table>
- <TR><TD>Release</TD> <TD>C Version</TD> <TD>Java Version</TD><TD>ANT Version</TD><TD>Eclipse Version Used</TD><TD>generated DLLs</TD></TR>
- <TR><TD>up to 1.6</TD><TD>VC 98 (6.0)</TD> <TD>? </TD><td>MAKE</td><TD>?</TD><TD>32 bit</TD></TR>
- <TR><TD>1.7</TD> <TD>VC 98 (6.0)</TD> <TD>1.4 (48)</TD><td>1.?</td><TD>?</TD><TD>32 bit</TD></TR>
- <TR><TD>1.8</TD> <TD>VC 98 (6.0)</TD> <TD>1.4 (48)</TD><td>1.?</td><TD>?</TD><TD>32 bit</TD></TR>
- <TR><TD>1.9</TD> <TD>VC 98 (6.0)</TD> <TD>1.4 (48)</TD><td>1.?</td><TD>?</TD><TD>32 bit</TD></TR>
- <TR><TD>1.10</TD> <TD>VC 98 (6.0)</TD> <TD>1.4 (48)</TD><td>1.?</td><TD>3.??</TD><TD>32 bit</TD></TR>
- <TR><TD>1.11</TD> <TD>VC 98 (6.0) & 2003 64bit libs</TD><TD>1.4.? (48)</TD><td>1.6.?</td><TD>3.2.1</TD><TD>32 and 64 bit</TD></TR>
- <TR><TD>1.12</TD> <TD>VC 98 (6.0) & 2003 64bit libs</TD><TD>1.4.2 (48)</TD><td>1.6.5</td><TD>3.2.2</TD><TD>32 and 64 bit</TD></TR>
- <TR><TD>1.13</TD> <TD>VC 2005 (8)</TD> <TD>1.4.2 (48)</TD><TD>1.7.0</TD><TD>3.3</TD><TD>32 and 64 bit</TD></TR>
- <TR><TD>1.14</TD> <TD>VC 2005 (8)</TD> <TD>1.5.0 (49)</TD><TD>1.7.0</TD><TD>3.3</TD><TD>32 and 64 bit</TD></TR>
- <TR><TD>1.15</TD> <TD>VC 2005 (8)</TD> <TD>1.5.0 (49)</TD><TD>1.7.0</TD><TD>3.4</TD><TD>32 and 64 bit</TD></TR>
- <TR><TD>1.17</TD> <TD>VC 2005 (8)</TD> <TD>1.5.0 (49)</TD><TD>1.8.4 Eclipse Embedded</TD><TD>4.3</TD><TD>32 and 64 bit</TD></TR>
- <TR><TD>1.18</TD> <TD>VS 2013 (12) Windows SDK 7.1A</TD><TD>1.6.0 (50)</TD><TD>1.8.4 Eclipse Embedded</TD><TD>4.3</TD><TD>32 and 64 bit</TD></TR>
- <TR><TD>1.19</TD> <TD>VS 2013 (12) Windows SDK 7.1A</TD><TD>1.8.0 (52)</TD><TD>1.10.1 Eclispse Embedded</TD><TD>4.7</TD><TD>32 and 64 bit</TD></TR>
-
- </table>
-
- Microsoft Visual Studio 13 supports 64 bit builds. so no additional tools are required.<BR>
- Microsoft changed the location of the windows sdk (formerly known as platform sdk) after VC 8.0. https://en.wikipedia.org/wiki/Microsoft_Windows_SDK
-
- <H1>Build Process</H1>
- The build process is based on ANT. You can run ANT from inside of eclipse or from the command line. Running from inside eclipse
- means you don't have any installation, pathing or configuration to do. You can just open the xml, select the target in the
- "Outline" pane, right mouse and then "run as ant" on the selected target.
- <p></p>
- The ant process is driven off of a configuration file named
- <code>compilation_tools.properties</code> that describes the locations of the JDK and Microsoft C++ tools. The
- <code>build.xml</code> file in the root directory contains examples of the contents of this file. There are two main ant targets.
- <UL>
- <li>"default" executes the following steps when using the default target.
- <UL>
- <li> Build the Java code</li>
- <li> Build the jni code</li>
- <li> create the dll</li>
- <li> create jar file</li>
- </UL>
- <li>"packageRelease" runs the above listed steps and then
-
- <UL>
- <LI>builds the javadoc</LI>
- <LI>builds a source zip</LI>
- <li>builds a binary zip with the javadoc</li>
- </UL>
- </li>
- </UL>
- <H1>Eclipse Java IDE</h1>
- You can open the jacob-project in Eclipse.
- <ol>
- <li>Open Eclipse</li>
- <li>File-->New-->Other...</li>
- <li>Java --> Java Project form Existing Ant Buildfile</li>
- <li>Click "next" to go to "Create a Java Project from an Ant Buildfile"</li>
- <li>Browse to and select build.xml in the project directory</li>
- <li>Select any of the javac tasks. This wall cause that one source directory to be added as a eclipse source directory.</li>
- </ol>
- <p></p>
- Eclipse users have to do some minor tweaks to their project if they want to use the integrated build process. This is because
- the unit tests are files located in the "unittest" directory while the project source files themselves are in "src" the root
- directory. By default, eclipse will add the entire project as source. This messes up the package naming. In addition, the
- build directory should be set to be the same place the ANT build puts the compiled java classes. A couple small tweaks to
- the build path fix these problems:
- <ol>
- <li> Open up the project properties and go to the "Java Build Path" properties panel. </li>
- <li> Remove the root of the project from the build path if it is there</li>
- <li> Add / verify the following folders are in the build path. Add them with "link source..." if they are missing
- <code>samples</code>,
- <code>src</code> and
- <code>unittest</code> to the build path in the Source tab.</li>
- <li>Add junit as a library "Add Library...Junit...Junit 4"</li>
- <li> Exclude *.txt from each of the newly added folders. </li>
- <li> Set the default build output directory to
- <code>jacob-project/release/java</code>
- </li>
- <li>Open "Windows-->Show View-->Project Explorer" </li>
- </ol>
-
- <h2> Troubleshooting Build Problems </h2>
- <ul>
- <li>
- Symptom: Build Failed can't find javac compiler. JAVA_HOME does not point to the JDK Problem:
- <br>The java library is pointed at a jre insted of the jdk. Update Project..Properties..Java Build Path to point at the JDK
- </li>
- <li>
- Symptom: The jar is built but no dlls were compiled.
- <br> Problem: compilation_tools.properties does not have the correct location for the Microsoft tools.
-
- </li>
- <li>
- Sympton: Can't find jni.h or can't find C++ compiler
- <BR> Problem: compilation_tools.properties configured incorrectly. Either paths are wrong or the separator is wrong. It requires
- two backslashes for a separator.
-
- </li>
- <li>
- Symptom: Ant fails with the message
- <CODE> Could not create task or type of type: junit.</CODE>.
- <BR> Problem: junit.jar must be copied from this project to the $ANT_HOME/lib directory.
-
- </li>
- </ul>
-
- <h1> Running Samples and Tests </h1>
- Samples and JUnit test programs can be found in the source jar or in CVS. The programs can be run from a bat file or from
- inside the Eclipse IDE. The java library path variable must be set to include the directory the jacob.dll is in. The simplest
- way to do that is to add it as a command line option. The following assume that your jacob development area is located in
- c:\dev\jacob:
- <pre>
- -Djava.library.path=c:/dev/jacob/release/x86
- -Dcom.jacob.autogc=false
- -Dcom.jacob.debug=false
- -Xcheck:jni
- </pre> JUnit test programs can be individually run from inside eclipse or en-masse via the
- <code>ant test</code> target.
- <h1> Git Bash environment configuration </h1>
- Example environment configuration for windows machine as of 2018/05
- <pre>
- JAVA_HOME="/c/Program Files (x86)/Java/jdk1.8.0_161"
- #JAVA_HOME="/c/Program Files/Java/jdk1.8.0_161"
- ANT_HOME=/c/dev/springsource-3.9.4-x64/sts-3.9.4.RELEASE/plugins/org.apache.ant_1.10.1.v20170504-0840
- PATH=$ANT_HOME/bin:$JAVA_HOME/bin:$PATH
- export PATH
- export ANT_HOME
- export JAVA_HOME
- </pre>
-
- <hr> Last Modified 05/2017 1.19
- </BODY>
- </HTML>
|