MATLAB BUILDER JA 2 User's Guide Page 260

  • Download
  • Add to my manuals
  • Print
  • Page
    / 292
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 259
6 Reference Infor mation for Java
setenv JAVA_HOME /java/jdk/j2sdk1.5.0
Alternatively, you can add jdk_directory\bin to the system path.
Java CLASSPATH Variable
To build and run a Java application that encapsulates MATLAB the system
needs to find
.jar files containing the MATLAB libraries and the class and
method definitions that you have developed and built with Java Builder. To
tell the system how to locate the
.jar files it needs, specify a classpath
either in the javac commandorinyoursystemenvironmentvariables.
Java uses the
CLASSPATH variable to locate user classes needed to compile
or run a given Java class. The class path contains directories where all the
.class and/or .jar files n ee de d by y our program reside. These .jar files
contain any classes that your Java class depends on.
When you compile a Java class that uses classes contained in the
com.mathworks.toolbox.javabuilder package, you need to include a file
called
javabuilder.jar on the Java class path. This file comes w i th Jav a
Builder; you can find it in the following directory:
matlabroot/toolbox/javabuilder/jar % (development machine)
mcrroot/toolbox/javabuilder/jar % (end-user machine)
where matlabroot refers to the root directory into which the MATLAB
installer has placed the MATLAB files, and
mcrroot refers to the root
directory under which mcr is ins tal led. Jav a Builder automatically
includes this
.jar file on the class path when it creates the component.
To use a class generated by Java Builder, you need to add this
matlabroot/toolbox/javabuilder/jar/javabuilder.jar to the class path.
In addition, you need to add to the class path the
.jar file created by Java
Builder for your compiled
.class files.
Example: Setting CLASSPATH o n Windows. Suppose your MATLAB
libraries are installed in
C:\matlabroot\bin\win32, and your component
.jar files are in C:\mycomponent.
6-4
Page view 259
1 2 ... 255 256 257 258 259 260 261 262 263 264 265 ... 291 292

Comments to this Manuals

No comments