User avatar
clicky
Posts: 409
Joined: Thu Oct 25, 2012 7:34 am

Compiling Eclipse on Pi (Pi4?)

Fri Jul 05, 2019 12:48 pm

Hi all,

I would like to start this discussion about Eclipse and Pi.
Now we have Pi4 and it getting close to a 'desktop computer' it would only be fitting to have appropriate (alternative) of Java IDE. I am aware that 'eclipse' (and 'eclipse-jdt') is available through standard Raspbian repos, but it is 3.8 (the latest is 4.12) and not upgradeable (there are some issues with repo setup).

I've tried to trawl the internet for anything else but failed. Only thing I found is source from where that 3.8 (I think) version came from: https://github.com/turesheim/eclipse-rpi.git

Following that I found this: https://git.eclipse.org/c/ and from there https://git.eclipse.org/c/platform/ecli ... gator.git/

I've played a bit with Torkild's script and tried to build newer versions - starting from R4_4 (which cannot be built due to being too old and pointing to non-existent repos) R4_12 (which doesn't have arm support any more) and ending up with R4_11 and failed.

I've tried to build it just through maven directly and I tried to build 'arm' (native) version and each time it would fail in different way. I tried to remedy some of the errors but not really managed to get anywhere.

Last thing I did was this: https://www.eclipse.org/forums/index.php/t/1099602/ (fingers crossed)

So, any ideas, pointers, previous experience or anything you can add regarding this subject - please post here :)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23885
Joined: Sat Jul 30, 2011 7:41 pm

Re: Compiling Eclipse on Pi (Pi4?)

Fri Jul 05, 2019 12:53 pm

My pointer is that I have given up trying to do this. The Eclipse build is a total mess. Debian are/were thinking of dropping it entirely from their repos because it's almost impossible to build.

If you do succeed - note down how you did it!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
clicky
Posts: 409
Joined: Thu Oct 25, 2012 7:34 am

Re: Compiling Eclipse on Pi (Pi4?)

Fri Jul 05, 2019 1:05 pm

I get it - there's quite a lot of 'hidden knowledge' buried there - somewhere.

BTW I am trying - this is the latest: https://github.com/turesheim/eclipse-rpi/issues/4
jamesh wrote: If you do succeed - note down how you did it!
Huh - of course. It is really hard to track going blind through options - especially when you're determined to do it. So many dead-ends and backtracking, etc. But, if nothing else if I (or someone else!) succeed in it - at least we'll know it is possible and I am happy to give it a go again (or assist anyone wanting to do so).

Also, it would be nice, then, propagating it further to the distro or something...

User avatar
clicky
Posts: 409
Joined: Thu Oct 25, 2012 7:34 am

Re: Compiling Eclipse on Pi (Pi4?)

Sat Jul 06, 2019 1:46 pm

OK. I moved from square one - I managed to create .so files in org.eclipse.swt.gtk.linux.arm of R4_11_maintenance branch.

Now, it is really proper bodge I end up with - manually finding build file, moving folders around, installing randomly 'stuff', etc...
But result is in:

Code: Select all

libswt-atk-gtk-4924r25.so
libswt-cairo-gtk-4924r25.so
libswt-glx-gtk-4924r25.so
libswt-gtk-4924r25.so
libswt-pi3-gtk-4924r25.so
libswt-webkit-gtk-4924r25.so
Full output:

Code: Select all

-e Cairo found, compiling SWT support for the cairo graphics library.
-e *** libjawt.so not found, the SWT/AWT integration library will not be compiled.
-e Building SWT/GTK+ for Architectures: linux armv7l
build.sh: 332: [: 1: unexpected operator
-e *** Warning: Cannot compile Webkit2 Extension because 'pkg-config --exists webkit2gtk-web-extension-4-0' check failed. Please install webkitgtk4-devel.ARCH on your system.
-e Building GTK3 bindings:
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  -c swt.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux    -c -o c.o c.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux    -c -o c_stats.o c_stats.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  -DUSE_ASSEMBLER -c callback.c
cc -shared -fPIC  -s -o libswt-gtk-4924r25.so swt.o c.o c_stats.o callback.o
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags gtk+-3.0 gtk+-unix-print-3.0` -c os.c
os.c: In function ‘Java_org_eclipse_swt_internal_gtk_GDK__1gdk_1window_1set_1background_1pattern’:
os.c:2973:2: warning: ‘gdk_window_set_background_pattern’ is deprecated [-Wdeprecated-declarations]
  gdk_window_set_background_pattern((GdkWindow *)arg0, (cairo_pattern_t *)arg1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gdk/gdkseat.h:28,
                 from /usr/include/gtk-3.0/gdk/gdkdisplay.h:33,
                 from /usr/include/gtk-3.0/gdk/gdkscreen.h:32,
                 from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:31,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from os.h:30,
                 from os_structs.h:19,
                 from os.c:20:
/usr/include/gtk-3.0/gdk/gdkwindow.h:790:12: note: declared here
 void       gdk_window_set_background_pattern (GdkWindow  *window,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
os.c: In function ‘Java_org_eclipse_swt_internal_gtk_GDK_gdk_1threads_1leave’:
os.c:3243:2: warning: ‘gdk_threads_leave’ is deprecated [-Wdeprecated-declarations]
  gdk_threads_leave();
  ^~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gdk/gdk.h:61,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from os.h:30,
                 from os_structs.h:19,
                 from os.c:20:
/usr/include/gtk-3.0/gdk/gdkthreads.h:48:10: note: declared here
 void     gdk_threads_leave                    (void);
          ^~~~~~~~~~~~~~~~~
os.c: In function ‘Java_org_eclipse_swt_internal_gtk_GTK__1gtk_1status_1icon_1get_1geometry’:
os.c:9266:2: warning: ‘gtk_status_icon_get_geometry’ is deprecated [-Wdeprecated-declarations]
  rc = (jboolean)gtk_status_icon_get_geometry((GtkStatusIcon*)arg0, (GdkScreen**)arg1, (GdkRectangle*)lparg2, (GtkOrientation*)arg3);
  ^~
In file included from /usr/include/gtk-3.0/gtk/gtk.h:275,
                 from os.h:30,
                 from os_structs.h:19,
                 from os.c:20:
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:166:23: note: declared here
 gboolean              gtk_status_icon_get_geometry       (GtkStatusIcon      *status_icon,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
os.c: In function ‘Java_org_eclipse_swt_internal_gtk_GTK__1gtk_1status_1icon_1get_1visible’:
os.c:9280:2: warning: ‘gtk_status_icon_get_visible’ is deprecated [-Wdeprecated-declarations]
  rc = (jboolean)gtk_status_icon_get_visible((GtkStatusIcon*)arg0);
  ^~
In file included from /usr/include/gtk-3.0/gtk/gtk.h:275,
                 from os.h:30,
                 from os_structs.h:19,
                 from os.c:20:
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:154:23: note: declared here
 gboolean              gtk_status_icon_get_visible        (GtkStatusIcon      *status_icon);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
os.c: In function ‘Java_org_eclipse_swt_internal_gtk_GTK__1gtk_1status_1icon_1new’:
os.c:9292:2: warning: ‘gtk_status_icon_new’ is deprecated [-Wdeprecated-declarations]
  rc = (jintLong)gtk_status_icon_new();
  ^~
In file included from /usr/include/gtk-3.0/gtk/gtk.h:275,
                 from os.h:30,
                 from os_structs.h:19,
                 from os.c:20:
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:84:23: note: declared here
 GtkStatusIcon        *gtk_status_icon_new                (void);
                       ^~~~~~~~~~~~~~~~~~~
os.c: In function ‘Java_org_eclipse_swt_internal_gtk_GTK__1gtk_1status_1icon_1set_1from_1pixbuf’:
os.c:9315:2: warning: ‘gtk_status_icon_set_from_pixbuf’ is deprecated [-Wdeprecated-declarations]
  gtk_status_icon_set_from_pixbuf((GtkStatusIcon*)arg0, (GdkPixbuf*)arg1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtk.h:275,
                 from os.h:30,
                 from os_structs.h:19,
                 from os.c:20:
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:97:23: note: declared here
 void                  gtk_status_icon_set_from_pixbuf    (GtkStatusIcon      *status_icon,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
os.c: In function ‘Java_org_eclipse_swt_internal_gtk_GTK__1gtk_1status_1icon_1set_1tooltip_1text’:
os.c:9327:2: warning: ‘gtk_status_icon_set_tooltip_text’ is deprecated [-Wdeprecated-declarations]
  gtk_status_icon_set_tooltip_text((GtkStatusIcon *)arg0, (const gchar *)lparg1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtk.h:275,
                 from os.h:30,
                 from os_structs.h:19,
                 from os.c:20:
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:137:23: note: declared here
 void                  gtk_status_icon_set_tooltip_text   (GtkStatusIcon      *status_icon,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
os.c: In function ‘Java_org_eclipse_swt_internal_gtk_GTK__1gtk_1status_1icon_1set_1visible’:
os.c:9339:2: warning: ‘gtk_status_icon_set_visible’ is deprecated [-Wdeprecated-declarations]
  gtk_status_icon_set_visible((GtkStatusIcon*)arg0, (gboolean)arg1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtk.h:275,
                 from os.h:30,
                 from os_structs.h:19,
                 from os.c:20:
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:151:23: note: declared here
 void                  gtk_status_icon_set_visible        (GtkStatusIcon      *status_icon,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
os.c: In function ‘Java_org_eclipse_swt_internal_gtk_OS__1g_1variant_1n_1children’:
os.c:16970:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  rc = (jlong)g_variant_n_children((GVariant *)arg0);
                                   ^
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags gtk+-3.0 gtk+-unix-print-3.0` -c os_structs.c 
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags gtk+-3.0 gtk+-unix-print-3.0` -c os_custom.c
os_custom.c: In function ‘swt_fixed_realize’:
os_custom.c:500:3: warning: ‘gtk_style_context_set_background’ is deprecated: Use 'gtk_render_background' instead [-Wdeprecated-declarations]
   gtk_style_context_set_background (gtk_widget_get_style_context (widget), window);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtkicontheme.h:27,
                 from /usr/include/gtk-3.0/gtk/gtk.h:127,
                 from os.h:30,
                 from os_structs.h:19,
                 from os_custom.c:17:
/usr/include/gtk-3.0/gtk/gtkstylecontext.h:1232:6: note: declared here
 void gtk_style_context_set_background       (GtkStyleContext *context,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags gtk+-3.0 gtk+-unix-print-3.0` -c os_stats.c
cc -shared -fPIC  -s -o libswt-pi3-gtk-4924r25.so swt.o os.o os_structs.o os_custom.o os_stats.o `pkg-config --libs-only-L gtk+-3.0 gthread-2.0`  -L/usr/X11R6/lib -lgtk-3 -lgdk-3 -lcairo -lgthread-2.0
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags atk gtk+-3.0 gtk+-unix-print-3.0` -c atk.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags atk gtk+-3.0 gtk+-unix-print-3.0` -c atk_structs.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags atk gtk+-3.0 gtk+-unix-print-3.0` -c atk_custom.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags atk gtk+-3.0 gtk+-unix-print-3.0` -c atk_stats.c
cc -shared -fPIC  -s -o libswt-atk-gtk-4924r25.so swt.o atk.o atk_structs.o atk_custom.o atk_stats.o `pkg-config --libs-only-L atk` -latk-1.0 
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux   -c glx.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux   -c glx_structs.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux   -c glx_stats.c
cc -shared -fPIC  -s -o libswt-glx-gtk-4924r25.so swt.o glx.o glx_structs.o glx_stats.o -lGL -lGLU -lm
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags gio-2.0` -c webkitgtk.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags gio-2.0` -c webkitgtk_structs.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags gio-2.0` -c webkitgtk_stats.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags gio-2.0` -c webkitgtk_custom.c
cc -shared -fPIC  -s -o libswt-webkit-gtk-4924r25.so swt.o webkitgtk.o webkitgtk_structs.o webkitgtk_stats.o webkitgtk_custom.o `pkg-config --libs-only-l gio-2.0`
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags cairo` -c cairo.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags cairo` -c cairo_structs.c
cc -O -Wall -fPIC -DSWT_VERSION=4924r25    -DLINUX -DGTK -I/usr/lib/jvm/current//include -I/usr/lib/jvm/current//include/linux  `pkg-config --cflags cairo` -c cairo_stats.c
cc -shared -fPIC  -s -o libswt-cairo-gtk-4924r25.so swt.o cairo.o cairo_structs.o cairo_stats.o `pkg-config --libs-only-L cairo` -lcairo
-e GTK3 Build succeeded
I really wish I have someone beside me who understands 'things' to help:
- why that build script is not invoked by ant
- what we really need for first error ("Please install webkitgtk4-devel.ARCH on your system") or is it just a red herring
- if I have .so files what then! (only thing I can think of is get some zip file distribution of eclipse for linux and replace existing .so files in there with those I created and hope for the best)
- do I need to build some other c files somewhere else (I'm sure that there are other places where c files exist)

Also, I'm aware that some of those questions really need to be posted at Eclipse people - but so far I've not no response over there...
-

User avatar
clicky
Posts: 409
Joined: Thu Oct 25, 2012 7:34 am

Re: Compiling Eclipse on Pi (Pi4?)

Sun Jul 07, 2019 7:13 pm

This is interesting:
- compiling R4_11_maintenance branch on Mac and RPi - fails!
- compiling R4_12_maintenance branch on Mac succeeds but fails on RPi

Difference between Mac and RPi are:
RPi: Java 1.8.0_211, mvn 3.6.0
Mac: Java 1.8.0_111, mvn 3.6.1

(I don't think that's what causes it to fail)

Now - I'll just try to compile .so files (and main 'eclipse' executable) on the same version on RPi and replace them in x86_64 build to try it out...

User avatar
clicky
Posts: 409
Joined: Thu Oct 25, 2012 7:34 am

Re: Compiling Eclipse on Pi (Pi4?)

Sun Jul 07, 2019 8:38 pm

Some progress:

Image
Attachments
eclipse-progress-1.jpg
eclipse-progress-1.jpg (178.3 KiB) Viewed 4864 times

jachaney
Posts: 13
Joined: Wed Jun 20, 2018 10:00 pm

Re: Compiling Eclipse on Pi (Pi4?)

Mon Jul 08, 2019 8:31 pm

I actually have been running Eclipse on my 3B+. Some features run a little slow but for the most part it works just great. The problem I had was switching to Raspbian v3.1.1(new Buster). The new Java causes the load version of Eclipse to crash at startup. Not happy with the twiddling Oracle has been doing to Java. Going to wait for the apt update for Eclipse to catch up I guess.

User avatar
clicky
Posts: 409
Joined: Thu Oct 25, 2012 7:34 am

Re: Compiling Eclipse on Pi (Pi4?)

Tue Jul 09, 2019 6:34 am

jachaney wrote:
Mon Jul 08, 2019 8:31 pm
I actually have been running Eclipse on my 3B+. Some features run a little slow but for the most part it works just great. The problem I had was switching to Raspbian v3.1.1(new Buster). The new Java causes the load version of Eclipse to crash at startup. Not happy with the twiddling Oracle has been doing to Java. Going to wait for the apt update for Eclipse to catch up I guess.
Which version of Eclipse? If it is one supplied by Raspbian repos (3.8) it is way too old. It works (I think :roll:) if you switch from OpenJDK 11 back to Oracle's JDK 1.8. And even then, I found out that I cannot access marketplace (was it called marketplace or was it delivered in that version of Eclipse at all?) nor update/upgrade/install anything...

User avatar
clicky
Posts: 409
Joined: Thu Oct 25, 2012 7:34 am

Re: Compiling Eclipse on Pi (Pi4?)

Fri Jul 12, 2019 4:30 pm

OK. Last night (I stayed late as it was so interesting) I had a breakthrough. I'm through the breeze blocks wall now - just to find steel reinforced concrete behind it! :roll:

Anyway - issues I had was because Java was passing 32bit (int!) method signatures to JNI layer and it couldn't find methods as they all had 'longs' (passing "(II)I" for signature while particular method was in reality "(JJ)J"). All in SWT.
I've fixed it in Java (6000+ lines class called Display plus a few minor bits) just for it to crash while JDK because of pointers (32bit pointers) passed around in (GDK class) in such ways it break things (my current theory). Maybe I am not thinking regarding it in the right way. Maybe I should look at 'fixing' it from perspective of JNI (c) code and keep Java code intact. That might be next attempt.

Launcher working (see previous posts with screen shot) gave me some moral boost... we'll see... It would be really great finding anyone involved in Eclipse project to at least say 'hi' in this or their forums or anyone else who is good with such kind of code tinkering... :)

Musketeer
Posts: 152
Joined: Fri Feb 12, 2016 1:23 pm
Location: CZ

Re: Compiling Eclipse on Pi (Pi4?)

Fri Jul 12, 2019 5:05 pm

... or yet better - port their Open J9 for ARM! :idea:
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!

lasthope106
Posts: 1
Joined: Sat Aug 17, 2019 10:49 pm

Re: Compiling Eclipse on Pi (Pi4?)

Sat Aug 17, 2019 10:52 pm

Spent a few hours trying to figure out how to install Eclipse. I think this is something worthwhile for the community now that the Pi can be used as a desktop replacement.

User avatar
clicky
Posts: 409
Joined: Thu Oct 25, 2012 7:34 am

Re: Compiling Eclipse on Pi (Pi4?)

Sun Aug 18, 2019 10:28 am

I've put it aside for a moment - got to see that Eclipse foundation decided not to support 32bit Eclipse any more and half of the code reflect it and another not. I tried to understand how C code and how Java code detects if it is 64bit platform or 32bit platform and failed. I tried to bodge code to extend and even that didn't work.

It seems it requires someone who understand things slightly more and is willing to put more time in it. I am more than happy to help or to try things someone else suggests - but right now I don't have many options open except long steep curve to learn more and just blindly trying again and again...

Return to “Java”