Eclipse from a Toolbox

Was wondering if it is possible to run Eclipse Java from a toolbox. I created a toolbox, created access to Java 8, then run eclipse but it gives me an error. Any suggestions would be welcome.
Thanks and BR,
Ralph

eclipse.buildId=4.12.0.I20190605-1800
java.version=1.8.0_221
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.osgi 4 0 2019-09-10 16:58:24.932
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: org.eclipse.swt.internal.gtk.OS._cachejvmptr()V
at org.eclipse.swt.internal.gtk.OS._cachejvmptr(Native Method)
at org.eclipse.swt.internal.gtk.OS.cachejvmptr(OS.java:492)
at org.eclipse.swt.internal.gtk.OS.(OS.java:91)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:209)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:155)
at org.eclipse.swt.widgets.Display.(Display.java:161)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:739)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:162)
at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:185)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:128)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
at org.eclipse.equinox.launcher.Main.main(Main.java:1441)

Hi @ralphkw1,

Did you install Eclipse from the command line or software center?

Installing Eclipse

Fedora SilverBlue Toolbox Docs

Side note: if your end goal is just to have Eclipse working, there are unofficial Flatpaks available: Eclipse Flatpaks

No install, just unzip into a local directory.

I usually have multiple instances of Eclipse with different configurations for each language or embedded target. I thought the concept of a container toolbox would be a natural. So flatpack install was less interesting.

1 Like

Okay, there’s a possibility your missing some build dependencies. I would try running the command below to ensure dependencies for eclipse are installed.

$ sudo dnf builddep eclipse

Thanks! This worked, not to sound ungrateful, :slight_smile: but WOW!

Transaction Summary

Install 529 Packages
Upgrade 8 Packages

Total download size: 546 M

Since I really don’t want to actually build eclipse I’d really like to figure out the minimum required to just run eclipse.
Thanks and BR,
Ralph

1 Like

After some trial and error, all I needed additionally to run eclipse was to dnf install gtk3 and librsvg2.

1 Like

Just in case anyone else wants to do this, here is a script for creating a toolbox to run Eclipse IDE. I place the decompressed Oracle Java JDK in my local ~/bin/ as well as the eclipse download. I have a script to set up java. Seems to work well so far.

make_eclipse_toolbox.sh:
-----------------------------------------------------------------
#!/bin/sh

echo off
set -eux

RELEASE=‘’
NAME=eclipse_toolbox

toolbox rm --force $NAME || true
toolbox create $RELEASE --container $NAME

toolbox run -c “$NAME” sh -exec ’
# Place java into a system accessible directory and add to environment.
sudo cp ~/bin/java_init.sh /etc/profile.d/
sudo mkdir /usr/local/java
sudo cp -avr ~/bin/java/jdk1.8.0_221/ /usr/local/java/

# Add eclipse runtime dependencies.
sudo dnf install gtk3 -y
sudo dnf install librsvg2 -y

sudo dnf clean packages

echo “to use run: toolbox enter --container $NAME”

java_init.sh:
-----------------------------------------------------------------
# /etc/profile.d/java_init.sh - JDK initialization script. Exports environment variables for JDK.

JAVA_HOME=/usr/local/java/jdk1.8.0_221
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH