|
Now that the proxies have been generated, we can use them to access .NET classes from Java.
Launch your favorite Java IDE (such as Eclipse), and create a new Java project.
Add the proxy jar file logging.jar (the one just generated) and
jnbcore.jar and
bcel-5.1-jnbridge.jar (distributed with JNBridgePro) to the project's build class path.
Next, add a new class and enter Java code such as the code on the left.
Note that strings passed to the Info(), Warn(), Error() and Debug() methods need to be
wrapped in a System.DotNetString object. This is because
Info(), Warn(), Error() and Debug()
all expect a parameter of class System.Object, and the Java String is not a subclass of
System.Object, while System.DotNetString is.
See the JNBridgePro User's Guide for more details.
|