You can use the jnbproxy command-line tool as an alternative to the jnbproxyGui program, to generate Java proxies. For moresinformation, see Generating the Java proxy classes.
For example, you can use this command in a batch file to generate multiple proxy JAR files in a single operation.
The jnbproxy command has the following format:
jnbproxy options... classes...
For example:
jnbproxy /al C:\dotNet\netdll\PrimitiveTypes.dll /d C:\dotNet\MyJavajars /host localhost /n PrimitiveTypes /nj /pd j2n /port 6085 /pro b /pp C:\ColdFusion8\lib CSharpDatatypes.PrimitiveTypes
The following table lists the options that you can use. To create proxies on a system that is running ColdFusion, use the /nj option and do not specify the /bp, /java, or /jp options.
Option |
Req/Opt |
Default |
Description |
---|---|---|---|
/al assemblylist |
Required |
|
Specifies a semicolon-separated series of file paths of .NET assemblies (DLL and EXE files) that contain the required .NET classes. |
/bp bcelpath |
Optional |
Use the CLASSPATH environment variable to locate the file. |
Specifies the path to the folder that contains the bcel.jar file. Ignored if you use the /nj option. |
/cf |
Required |
|
Use the ColdFusion software license. If you do not include this option, your proxies are limited to a 30-day trial period. |
/d directory |
Optional |
The current execution directory. |
Specifies the directory in which to write a JAR file with the generated proxies. |
/f classfile |
Optional |
|
Reads the classes from the specified text file, not the command line. For more information, see the JNBridge documentation. |
/h |
Optional |
|
Lists the options and usage information. Typing the command jnbproxy with no options or arguments results in the same information. |
/host hostname |
Required |
|
Specifies the host on which the .NET code is located. This option can be a host name or an IP address. Normally, you specify localhost. |
/java javapath |
Optional |
Use the first java.exe file found using the system PATH environment variable. |
Specifies the path of the directory that contains the java.exe program to use when automatically starting Java. Ignored if you use the /nj option. |
/jp jnbcorepath |
Optional |
Use, the CLASSPATH environment variable. |
Specifies the path of the folder containing the file jnbcore.jar. Ignored if you use the /nj option. |
/ls |
Optional |
Generate and list the proxies. |
Lists all classes to be generated in support of the specified classes (see Supporting classes), but don't generate the proxies. |
/n name |
Optional |
Create a file named jnbproxies.jar. |
Specifies the name of the JAR file in which to put the proxies. Do not specify the .jar extension; the tool automatically adds it. |
/nj |
Optional |
Start Java automatically. |
Does not start Java automatically. If you use this option, Java must be running, and the /bp, /java, /jp, and /wd options, if present, are ignored. |
/ns |
Optional |
Generate proxies for all supporting classes. |
Generates proxies for the classes specified on the command line (or class file) only, not for any supporting classes. |
/pd |
Required |
|
Specifies the direction in which the proxies operate. Must be j2n. |
/port portNum |
Required |
|
Specifies the port on which the .NET side listens when generating the proxies. Must be an integer. Normally this value is 6085. |
/pro protocol |
Required |
|
Specifies the communication mechanism between the .NET and Java sides. The valid values are:
|
/wd dir |
optional |
The system's default working directory. |
Specifies the working directory for the JVM. Ignored if the /nj option is present. |
A space-separated sequence of fully qualified .NET class names (for example, CSharpDatatypes.PrimitiveTypes) for which proxies should be generated. The proxies for System.Object and System.Type are always generated, even if they are not listed in the class list.