10
10
http://www-106.ibm.com/developerworks/java/jdk/linux/tested.html for product
13
(2) Set environment variables (under tcsh. For bash use the export
14
variable=value syntax.)
15
# Your location for the java SDK will vary depending on where you unpack the
17
setenv JAVA_HOME /home/software/java/IBMJava2-14/
18
setenv PATH $PATH":$JAVA_HOME/bin"
13
(2) If the java include files are not in a default include directory then
14
you need to tell configure where they are. You can either use the
15
--with-java-home option to set the SDK directory e.g.
16
./configure --with-java-home=/home/software/java/IBMJava2-14/
17
Previously this was done via the environment variables JAVA_HOME, which
18
still works for backwards compatibility.
20
20
(3) The rest is highly automated. Move to the top-level PLplot build
21
21
directory and configure, build, and install.
52
52
a tarball). 'make' builds the java interface shared object module (DLL)
53
53
plplotjavac_wrap.SOBJEXT from plplotjavac_wrap.c. 'make' also builds the
54
54
class files corresponding to the swig-generated java files, the configured
55
config.java file, and the hand-crafted PLStreamc.java file. (Note the c
56
suffix on the name. In contrast, PLStream.java and javabind.c are
57
historical files we are only keeping around for reference, see below.) The
58
relevant java files and corresponding class files that are compiled from
59
them make up the plplot.core package.
55
config.java file, and the PLStream.java file which is hand-crafted (swig
56
might be able to do this in future) so that calling a method in the class
57
will ensure the stream is correctly set before calling the underlying API
58
function. The relevant java files and corresponding class files that are
59
compiled from them make up the plplot.core package.
61
Note that a quite different PLStream.java file that was used in the
62
historical hand-crafted interface to java (discussed below) is now stored in
63
the old subdirectory of the top-level source tree for reference purposes.
64
Note javabind.c from that historical interface is also stored in the old
61
67
'make install' installs the relevant java and class files that are part of
62
the plplot.core package in $prefix/lib/java/plplot/core, installs the
63
shared object module (DLL) plplotjavac_wrap.SOBJEXT for the java PLplot
64
interface in the same location, and also installs (from ../../examples/java)
65
the example java scripts and corresponding class files that are part of the
66
plplot.examples package into $prefix/lib/java/plplot/examples. For
67
more details about the examples, please see
68
../../examples/java/README.javademos or the installed version of that file
69
in /usr/local/plplot/lib/java/plplot/examples.
68
the plplot.core package in $prefix/share/java/plplot/core,
69
installs the shared object module (DLL) plplotjavac_wrap.SOBJEXT for the
70
java PLplot interface in the $prefix/lib/jni, and also installs
71
(from ../../examples/java) the example java scripts and corresponding class
72
files that are part of the plplot.examples package into
73
$prefix/share/plplot5.3.1/java/plplot/examples. For more details about the
74
examples, please see ../../examples/java/README.javademos or the installed
75
version of that file in $prefix/share/plplot5.3.1/examples/java/. Copies of
76
the java files are also in this directory for convenience.
77
At the end of the install process all the files in
78
$prefix/share/java/plplot/ are bundled into a jar file
79
$prefix/share/java/plplot.jar and the plplot directory is
71
82
Here is how to add a new function to the Java API for PLplot:
101
112
java rather than C. Note the raw interface only allows two-dimensional xg,
102
113
and yg arrays to plcont, plshades, and plshade. The options of no xg, yg,
103
114
and one-dimensional xg, and yg should also be allowed for the UI interface.
104
Also note the raw interface to plParseOpts demands you must be explicit
115
Also note the raw interface to plparseopts demands you must be explicit
105
116
about ORing in pls.PL_PARSE_NOPROGRAM to the parse mode parameter. This
106
117
idiosyncrasy of Java should be hidden for the UF interface.
110
121
user-friendly simplified argument list variations that have been implemented
113
* Each example has a rather ugly combination of two commands:
115
PLStreamc plsdummy = new PLStreamc();
116
plplotjavac pls = new plplotjavac();
118
The first one dynamically loads the wrapper library (with the stream stuff
119
commented out because the plplot API is not available to that class at the
120
moment), and the second one loads the plplotjavac wrapper made by swig which
121
then pulls in everything else that is required. Obviously, this should all
122
be done with one command where we refer to PLStream, the user-friendly
123
wrapper which in turn wraps PLStreamc, which in turn (after loading the
124
library) wraps plplotjavac and then finishes with the stream stuff that
125
Geoffrey put in for the old interface. But it is going to require somebody
126
(that word again....;-)) more expert in Java than me to implement this. As
127
I said above, I can fill out all the required argument list variations once
128
somebody shows me how to make just one of them.
130
124
* Only the default java double-precision can be used from Java. That is
131
125
what the examples use (by default) and that is what works. I believe the way
132
126
to do this properly with swig is simply to make both single and double
147
141
what is done for the Tcl interface rather than the preferred complete
148
142
callback approach used for the Python interface.
150
Alan W. Irwin (last updated on 2004-02-15.)
145
Andrew Ross (last updated 2004-07-01)
151
146
_________________________________________________________________
153
148
The following notes (written by Geoffrey Furnish with some minor editing
155
150
partial Java interface to PLplot. The resulting PLStream.java and
156
151
javabind.c files were quite useful in helping to understand what was needed
157
152
for the swig interface, and they may also be used to resolve any swig
158
problems in the future. Thus, we will keep them in CVS for a while,
159
although they are no longer used to build the Java interface to PLplot.
153
problems in the future. Thus, we will keep them in CVS (in the old
154
subdirectory of the top-level source tree) for reference.
161
156
Here is the historical hand-crafted way to add additional PLplot API to Java
162
157
under jdk 1.3.1. This may well work for other jdk versions, but it has not