java - Why doesn't GCJ find the classes from my imported packages? -
I want to compile a small Java application into a Windows executable.
This application is very small, there is only one main square, but it uses Apache POI.
When I compile it, then everything is fine, as long as I put the POI jar into the class path logic.
But when it comes to linking, GCJ can not solve the references of classes in the PoI package. The messages are all like this:
undefined reference tp 'org :: apache :: poi: hssf: usermodel: HSSFWorkbook :: class $'
What do I have to do to link my application?
You can separate .so
libraries in the imported jar - To provide a jar in classpath
, be sure to compile libraries while compiling your code.
An example, where I am compiling the GNU crypto library:
gcj --classpath = source /: libs / gnu-crypto.jar -fjni -c libs / Gnu-crypto.jar -o libs / gnu-crypto.o gcj -shared -fPIC Finally, execute your executable through a shell script referenced to the library path. For example: #! / Bin / sh exported LD_LIBRARY_PATH =. / Libs /: $ LD_LIBRARY_PATH exec ./MyJavaApp $ *
Comments
Post a Comment