From 78df811cea5848eecdf44b4cb881982359790b7c Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 8 Aug 2003 12:01:21 +0000 Subject: [PATCH] -outdir added git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4986 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Doc/Manual/Java.html | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/SWIG/Doc/Manual/Java.html b/SWIG/Doc/Manual/Java.html index 5a5af0834..598701610 100644 --- a/SWIG/Doc/Manual/Java.html +++ b/SWIG/Doc/Manual/Java.html @@ -195,6 +195,7 @@ rest of your C/C++ application. The name of the wrapper file is derived from the name of the input file. For example, if the input file is example.i, the name of the wrapper file is example_wrap.c. To change this, you can use the -o option. +It is also possible to change the output directory that the Java files are generated into using -outdir.

15.2.2 Additional Commandline Options

@@ -210,13 +211,13 @@ The following table list the additional commandline options available for the Ja --package <java package> -set the name of the package for the generated classes +-package <name> +set name of the Java package to <name> -noproxy -Generate the low-level functional interface instead of proxy classes +generate the low-level functional interface instead of proxy classes @@ -348,7 +349,8 @@ $ This error usually indicates that you forgot to include some object files or libraries in the linking of the native library file. Make sure you compile both the SWIG wrapper file and the code you are wrapping into the native library file. Also make sure you pass all of the required libraries to the linker. -You may get some more clues on unresolved symbols if you use the -verbose:jni commandline switch when running Java. +The java -verbose:jni commandline switch is also a great way to get more information on unresolved symbols. +One last piece of advice is to beware of the common faux pas of having more than one native library version in your path.

In summary, ensure that you are using the correct C/C++ compiler and linker combination and options for successful native library loading. @@ -532,7 +534,14 @@ The JNI (C/C++) code is generated into a file which also contains the module nam or example_wrap.c. These C or C++ files complete the contents of the module.

-The generated Java classes can be placed into a Java package by using the -package commandline option. +The generated Java classes can be placed into a Java package by using the -package commandline option. +This is often combined with the -outdir to specify a package directory for generating the Java files. + +

+swig -java -package com.bloggs.swig -outdir com/bloggs/swig example.i
+
+ +SWIG won't create the directory, so make sure it exists beforehand.

15.3.2 Functions