java/eclipse port

From: Jonathan Chen <>
Date: Mon, 30 May 2022 21:21:56 UTC

I'm the maintainer for java/eclipse. If you're a user, you've probably 
been wondering why it hasn't been updated for nearly 2 years. 
Unfortunately, I had been stuck on 2 critical issues that prevented any 

The first was a change in the build-packaging. This has finally been 
resolved, thanks to Patrick Mackinlay; and the port finally generates a 

However, the 2nd issue is that the JNI interface to SWT is not working. 
 From version 4.17 onwards, Eclipse will crash when it attempts to use 
SWT widgets to display HTML text. This is especially noticeable with the 
"Tip of the Day", or hovering over methods (at which point Eclipse 
attempts to display the Javadoc associated with the method and crashes).

Current thread (0x000000080328a000):  JavaThread "main" 
[_thread_in_native, id=476771, stack(0x00007fffdfefd000,0x00007fffdfffd000)]

Stack: [0x00007fffdfefd000,0x00007fffdfffd000],  sp=0x00007fffdfff9438, 
  free space=1009k
Native frames: (J=compiled Java code, A=aot compiled Java code, 
j=interpreted, Vv=VM code, C=native code)
C  []  short+0x54
J 2379  org.eclipse.swt.internal.C.strlen(J)I (0 bytes) @ 
0x000000081379320c [0x0000000813793140+0x00000000000000cc]
v  ~StubRoutines::call_stub
V  []  AsyncGetCallTrace+0xf0ef5
V  []  AsyncGetCallTrace+0x147955
V  []  AsyncGetCallTrace+0x14a749
C  []  char+0x1f0
C  []  float+0x16
C  []  __float128+0x116
C  []  __float128+0xb0d
C  []  __float128+0xae9
C  []  __float128+0x86
C  []  wchar_t+0x348

I suspect that there's some magic flag that I've missed when building 
the JNI interface to SWT. In the build logs, there is a section with the 
current build flags, ie:

[INFO]      [exec] Cairo found, compiling SWT support for the cairo 
graphics library.
[INFO]      [exec] found, the SWT/AWT integration library 
will be compiled.
[INFO]      [exec] Building SWT/GTK+ for Architectures: freebsd amd64
[INFO]      [exec] Building GTK3 bindings:
[INFO]      [exec] cc -O -Wall -fPIC -DSWT_VERSION=4946r21    -DFREEBSD 
-DGTK -I`pkg-config --variable=prefix gtk+-3.0`/include 
-I/usr/local/openjdk11/include -I/usr/local/openjdk11/include/freebsd 
-DJNI64 -m64 -Werror -c swt.c
[INFO]      [exec] cc -O -Wall -fPIC -DSWT_VERSION=4946r21    -DFREEBSD 
-DGTK -I`pkg-config --variable=prefix gtk+-3.0`/include 
-I/usr/local/openjdk11/include -I/usr/local/openjdk11/include/freebsd 
-DJNI64 -m64 -Werror   -c -o c.o c.c

I've played around with possible flags, the most recent being 
"-mstack-alignment=16". Any help/insights from anyone on the list would 
be most appreciated.

Jonathan Chen <>