aqua-kos
@aqua-kos

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

ubuntu上でのEclipseインストール時のエラーについて

前提・実現したいこと

初心者で初めて開発をしようと思っています。

ubuntu上でJavaの開発環境を作ろうと思っています。
Eclipseをインストールし、Pleiadesを使い日本語化をしようと思っていましたが、Eclipseインストール時にエラーが発生しました。
javaのバージョンは
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+12-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 17.0.1+12-Ubuntu-120.04, mixed mode, sharing)
JDKのバージョンは
javac 17.0.1
になります。

Eclipseは
https://www.eclipse.org/downloads/
からIDEのLinuxの「 eclipse-jee-2021-12-R-linux-gtk-x86_64.tar.gz」をダウンロードしました。

作業場所は
ubuntu/home/ユーザ名に「 eclipse-jee-2021-12-R-linux-gtk-x86_64.tar.gz」の中をすべて解答し、新しく「eclipse-installer」というフォルダが出来上がりました。

ubuntu/home/ユーザ名/eclipse-installer
内でubuntu上で「./eclipse-inst」を実行したところ

発生している問題・エラーメッセージ

ubuntu/home/ユーザ名/eclipse-installer
内でubuntu上で「./eclipse-inst」を実行したところ
Eclipse Installer:
An error has occurred. See the log file
/home/ユーザ名/eclipse-installer/configuration/1639836330779.log.
が出てきました
ログを確認したところ

!SESSION 2021-12-18 23:05:30.488 -----------------------------------------------
eclipse.buildId=unknown
java.version=17.0.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
Command-line arguments:  -os linux -ws gtk -arch x86_64 -data @noDefault

!ENTRY org.eclipse.osgi 4 0 2021-12-18 23:05:33.953
!MESSAGE An error occurred while automatically activating bundle org.eclipse.oomph.setup.installer (143).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.oomph.setup.internal.installer.SetupInstallerPlugin$Implementation.start() of bundle org.eclipse.oomph.setup.installer.
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:828)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:759)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1019)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
    at org.eclipse.osgi.container.Module.doStart(Module.java:605)
    at org.eclipse.osgi.container.Module.start(Module.java:468)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:404)
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:570)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:335)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:384)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:475)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:403)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:616)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:920)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.swt.widgets.Display
    at org.eclipse.oomph.setup.internal.installer.SetupInstallerPlugin$Implementation.start(SetupInstallerPlugin.java:133)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.lambda$2(BundleContextImpl.java:808)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:802)
    ... 32 more
Root exception:
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.swt.widgets.Display
    at org.eclipse.oomph.setup.internal.installer.SetupInstallerPlugin$Implementation.start(SetupInstallerPlugin.java:133)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.lambda$2(BundleContextImpl.java:808)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:802)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:759)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1019)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:920)
    at 

!ENTRY org.eclipse.osgi 4 0 2021-12-18 23:05:34.039
!MESSAGE Application error
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.oomph.setup.installer was unable to load class org.eclipse.oomph.setup.internal.installer.InstallerApplication.
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:212)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:198)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:920)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.oomph.setup.installer (143).
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:126)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:570)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:335)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:384)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:475)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:403)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:616)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196)
    ... 16 more
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.oomph.setup.internal.installer.SetupInstallerPlugin$Implementation.start() of bundle org.eclipse.oomph.setup.installer.
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:828)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:759)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1019)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
    at org.eclipse.osgi.container.Module.doStart(Module.java:605)
    at org.eclipse.osgi.container.Module.start(Module.java:468)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:404)
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
    ... 25 more
org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:802)
    ... 32 more

申し訳ありませんがエラー文で調べても英語のページしか出てこずわかりかねていました。

1

2Answer

最近(2024/1/17)同じような状況にまた出くわした(&他の記事が解決への参考にあまりならなかった‥)ので,こちらでの解決策を示しておきます.
症状:Ubuntu (22.4/20.4) 等で Eclipse をインストールしようとして eclipse-inst-jre-linux64.tar.gz を展開して用意したインストーラ ./eclipse-installer/eclipse-inst を実行すると下記のようにエラーが出て止まってしまう.
SWT OS.java Error: Failed to load swt-pi3, loading swt-pi4 as fallback.
Eclipse Installer:
An error has occurred. See the log file
対応策:logファイルを見るとswtがないのが原因なので,その辺りをインストールする.
$ sudo apt update
$ sudo apt-cache search libswt
$ sudo apt install libswt-gtk-4-java libswt-gtk-4-jni
ちなみに,これに関連して,日本語関連+ツールでeclipseに必要そうなものを予めインストールしておいてから ./eclipse-installer/eclipse-inst すると文字化けなどが無くなって幸せかもしれません.
$ sudo apt install gcc g++ gdb make
$ sudo apt install fonts-noto-cjk fonts-mplus fonts-ipafont-gothic fonts-ipafont-mincho fonts-ipaexfont-gothic fonts-ipaexfont-mincho fonts-vlgothic
$ ./eclipse-installer/eclipse-inst
(フォントは https://lab4ict.com/system/archives/11338 を参考にしました)
もしこれで解決する人がいたら幸いです.

1Like

Your answer might help someone💌