When building devel/gcc41-withgcjawt or devel/gcc41 with WITH_JAVA_AWT defined the AWT library seems not to be built. This results in the error "java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit" when you try to run a java application. Fix: Apply the attached patch to the port's Makefile. I don't know if it is the cleanest or best solution because I have no experience with creating ports but it works for me. Patch attached with submission follows: How-To-Repeat: Copy the following source code into the file "Hello2.java", compile it with "gcj41 Hello2.java --main=Hello2" and execute ./a.out //// begin Hello2.java //// import javax.swing.*; public class Hello2 extends JFrame { public static void main(String[] args) { Hello2 h = new Hello2(); h.setVisible(true); } public Hello2() { super("Hello World"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); pack(); } } //// end Hello2.java ////
Responsible Changed From-To: freebsd-ports-bugs->gerald Over to maintainer
State Changed From-To: open->closed Thanks for the report and the patch. We could not take the patch in its current form since that would have defeated the main purpose of the original changes (namely, to use OPTIONS in the future). Based on discussions with some fellow FreeBSD ports committers I have, however, committed a patch we believe resolves the problem you have seen in a different way, keeping the road for the use of OPTIONS open. http://www.freebsd.org/cgi/query-pr.cgi?pr=111544 Adding to audit trail from misfiled email message caught in spamtrap:
I might be wrong, but doesn't the Makefile still have a problem? (I haven't tested it so far, but I doubt it will work correctly.) The logic currently seems to be: .if ! defined(WITHOUT_JAVA) # Java stuff .else # i.e: "if defined(WITHOUT_JAVA)" # Non-Java stuff .if defined(WITH_JAVA_AWT) # Executed only if WITHOUT_JAVA defined? # ... .endif .endif I think the WITH_JAVA_AWT block should be moved in the !defined(WITHOUT_JAVA) block (if you want AWT, it doesn't make sense to define WITHOUT_JAVA...). Regards, Jonas
On Mon, 16 Apr 2007, Jonas Wolz wrote: > I might be wrong, but doesn't the Makefile still have a problem? I'm afraid you're right. I am not actually using this functionality, just hosting it in my lang/gcc ports, and none of those interested have spotted the issue so far it seems. A fix is in testing right now... Gerald
gerald 2007-04-16 14:26:08 UTC FreeBSD ports repository Modified files: lang/gcc42 Makefile Log: Move the WITH_JAVA_AWT bits into the ! WITHOUT_JAVA branch, that is, enable this only when Java is enabled. PR: 111544 Revision Changes Path 1.310 +3 -3 ports/lang/gcc42/Makefile _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
gerald 2007-04-17 05:23:40 UTC FreeBSD ports repository Modified files: lang/gcc41 Makefile distinfo Log: Update to the 20070416 snapshot of GCC 4.1.3. Move the WITH_JAVA_AWT bits into the ! WITHOUT_JAVA branch, that is, enable this only when Java is enabled. PR: 111544 Revision Changes Path 1.320 +4 -4 ports/lang/gcc41/Makefile 1.198 +15 -18 ports/lang/gcc41/distinfo _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
gerald 2007-04-21 07:41:05 UTC FreeBSD ports repository Modified files: lang/gcc43 Makefile distinfo Log: Update to the 20070420 snapshot of GCC 4.3.0. Move the WITH_JAVA_AWT bits into the ! WITHOUT_JAVA branch, that is, enable this only when Java is enabled. PR: 111544 Revision Changes Path 1.309 +4 -4 ports/lang/gcc43/Makefile 1.197 +18 -18 ports/lang/gcc43/distinfo _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"