[javaCompiler-users] Building a DLL with JavaCompiler?
Status: Beta
Brought to you by:
soapy
From: Jesper J. / S. G. <je...@so...> - 2006-09-17 18:05:01
|
Hi I am having problems getting a DLL to work with JavaCompiler 0.7 and 0.8, and I wonder if somebody has a suggestion for how to get it to work. I hope someone has an idea of whether this is a known gcj problem, or I am missing some parameter to make it work. Thanks! -Jesper **** The problem: ***** The actual program I am working on is too big to post here, but I have made a very simple test case with two classes, Test and TestB: public class Test { public static void main(String args[]) { TestB t=new TestB(); t.hi(); } } * public class TestB { public void hi() { System.out.println("Yes!"); } } * I compile them like this gcj -shared -I. TestB.java -o TestB.dll gcj -I. Test.java TestB.dll --main=Test -o Test.exe Compilation gives this info/warning: Info: resolving TestB::class$ by linking to __imp___ZN5TestB6class$E (auto import) If I run the Test.exe program, I get this error (JavaCompiler 0.7) Exception in thread "main" java.lang.NoClassDefFoundError: TestB at 0x562408(Unknown Source) For JavaCompiler 0.8: Exception in thread "main" java.lang.NoClassDefFoundError: TestB at java.lang.Class.initializeClass(Test.exe) Caused by: java.lang.NullPointerException <<No stacktrace available>> |