T
tony_lincoln
Dear friends,
I am using JNI to call java from C++. I use j2sdk1.4.1 and Visual C++
6. It works well if all codes are in the same directory. That is,
invoke.cpp, DemoMain.class and IOTestOhnePackage.class are in the same
dir, invoke.cpp call the main() in DemoMain.class, and DemoMain.class
uses one method in IOTestOhnePackage.class.
However, for the complicated system, DemoMain.class should be able to
use lots of java classes which are distributed in different
directories. In this case, Package is necessary.
If I add "Package com.tony.JNIClass;" into the 1st line of
IOTestOhnePackage.java. Compile it, then put this class into
E:\codes_Tony\com\tony\JNIClass, at the same time I set Parameters in
Visual C++ 6:
In Tools->Options->Include Files: E:\codes_Tony
In Tools->Options->Library Files: E:\codes_Tony
When I execute invoke.cpp, the program did not crash, but the part to
call class IOTestOhnePackage was jumped.
I know this is because of some setting problems, maybe in Visual C++,
maybe in System Path. But how? Any hints?
Thanks a lot.
Tony
I am using JNI to call java from C++. I use j2sdk1.4.1 and Visual C++
6. It works well if all codes are in the same directory. That is,
invoke.cpp, DemoMain.class and IOTestOhnePackage.class are in the same
dir, invoke.cpp call the main() in DemoMain.class, and DemoMain.class
uses one method in IOTestOhnePackage.class.
However, for the complicated system, DemoMain.class should be able to
use lots of java classes which are distributed in different
directories. In this case, Package is necessary.
If I add "Package com.tony.JNIClass;" into the 1st line of
IOTestOhnePackage.java. Compile it, then put this class into
E:\codes_Tony\com\tony\JNIClass, at the same time I set Parameters in
Visual C++ 6:
In Tools->Options->Include Files: E:\codes_Tony
In Tools->Options->Library Files: E:\codes_Tony
When I execute invoke.cpp, the program did not crash, but the part to
call class IOTestOhnePackage was jumped.
I know this is because of some setting problems, maybe in Visual C++,
maybe in System Path. But how? Any hints?
Thanks a lot.
Tony