| 69 | The result, in the gdal/swig/java directory, should be the following files: gdal.jar, gdalconstjni.dll, gdaljni.dll, ogrjni.dll and osrjni.dll. |
| 70 | |
| 71 | == Test Sample Application == |
| 72 | |
| 73 | First, ensure that java.exe and javac.exe are available in your path and that any DLLs on which GDAL depends are in your path. |
| 74 | |
| 75 | {{{ |
| 76 | cd swig\java\apps |
| 77 | copy ..\..\..\*.dll |
| 78 | copy ..\*.dll |
| 79 | javac -classpath ..\gdal.jar;. gdalinfo.java |
| 80 | java -classpath ..\gdal.jar;. gdalinfo |
| 81 | }}} |
| 82 | |
| 83 | You should get a usage message, or add a filename to the end of the last command to see a gdalinfo style report on the file. |
| 84 | |
73 | | d. Move the following files from ''<gdal-dir>''\swig\java to ''<gdal-dir>''\swig\java\apps: |
74 | | {{{ |
75 | | - gdalconstjni.dll |
76 | | - gdaljni.dll |
77 | | - ogrjni.dll |
78 | | - osrjni.dll |
79 | | }}} |
80 | | |
81 | | e. Copy the following files from ''<geos-dir>''\source to ''<gdal-dir>''\swig\java\apps: |
82 | | {{{ |
83 | | - geos.dll |
84 | | - geos_c.dll |
85 | | }}} |
86 | | |
87 | | f. Check that ''<gdal-dir>''\swig\java\gdal.jar has been created. If it has not been created, run “ant” in the ''<gdal-dir>''\swig\java directory to compile the Java sources into gdal.jar. |
88 | | |
89 | | '''8. Compile and run Java applications''' |
90 | | |
91 | | a. Place a Java source file in ''<gdal-dir>''\swig\java\apps. |
92 | | |
93 | | b. Open a command line window (i.e., "cmd") and change directory to ''<gdal-dir>''\swig\java\apps. |
94 | | |
95 | | c. To compile a Java file, enter "javac ''<file>''.java". |
96 | | |
97 | | d. To launch a Java application, enter "java ''<class>''". |