LoginSignup
1
5

More than 3 years have passed since last update.

Eclipseが起動しなくなった時の対応方法

Last updated at Posted at 2020-10-26

事象 : OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

  • 環境
    • macOS
    • openjdk version "1.8.0_212"
# Eclipseをターミナルからクリーン起動したらなんか言われた
$ /opt/eclipse/eclipse -clean
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

原因 : Java8からPermanent領域がなくなったのに設定するから

さて、Java 8では、Perm領域の指定が出来なくなりました。
具体的には、Javaの実行コマンドラインに

-XX:PermSize=128M -XX:MaxPermSize=256M

と指定しても、

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128M; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Kesu's Blog Java 8 ではPerm領域の指定が出来なくなりました

対応 : Permanent領域の設定を削除する

eclipse.ini

org.eclipse.platform
; これ↓と
--launcher.XXMaxPermSize
256m
-vmargs
; これ↓を削除する
-XX:MaxPermSize=256m 

事象 : Version 1.8.0_251 of the JVM is not suitable for this product. Version: 1.11 or greater is required.

  • 環境
    • Windows10 Pro バージョン1909
    • Eclipse IDE for Enterprise Java Developers Version: 2020-09 (4.17.0)

いろいろ問題があって・・・試しにEclipseを起動するJVMをeclipse.iniで変えてみた。
PATHを通しているJavaのバージョンは1.8.0_251だった。
そして起動しない・・・

eclipse.ini
; ...-vmをコメントアウトした...
-Dosgi.dataAreaRequiresExplicitInit=true
;-vm
;C:/apps/Java/jdk-11/bin/javaw.exe
-startup
; ...省略...

image.png

原因 : 起動したいバージョンのEclipseの起動に必要なJVMよりバージョンが古いから

メッセージの訳
JVMのバージョン1.8.0_251は、この製品には適していません。バージョン:1.11以降が必要です。

対応 : eclipse.iniの-vmの指定をJava11にする

eclipse.iniの-vmをJava11にするかJAVA_HOMEをJava11にする
今回は、eclipse.iniでコメントアウトしたところを戻した

事象 : Error opening zip file or JAR manifest missing : dropins/MergeDoc/eclipse/plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar

  • 環境
    • Windows10 Pro バージョン1903
    • openjdk version "11.0.2" 2019-01-15
    • Pleiades All in One EclipseのWindows 64bit Java Standard Edition をダウンロードして展開した
$ /c/app/pleiades/eclipse/eclipsec.exe -clean
Error occurred during initialization of VM
agent library failed to init: instrument
Error opening zip file or JAR manifest missing : dropins/MergeDoc/eclipse/plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar

原因 : 不明

  • Windowsであるあるのzipファイル解凍の問題かと思ってunzipコマンドと7-ZIPを試したけれど事象は変わらなかった
    • Windows標準の展開ウィザードはエラーになって解凍できなかった 7.png
  • eclipse.iniで日本語化のプラグインを無効にするとEclipseは起動するがその後workspaceが作れないとかなんかごねる
    • -Xverify:none-javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jarをコメントアウトすると無効にできる
    • 参考 : /pleiades/eclipse/readme/readme_pleiades.txt

諦めた対応 : 日本語化していない普通のEclipseを使う

別に日本語化してなくてもいい・・・もう面倒くさい

  1. 使えないEclipseはディレクトリもろとも削除する
  2. https://www.eclipse.org/ からインストーラ(eclipse-inst-jre-win64.exe)をダウンロードする
  3. インストーラを起動して[Eclipse IDE for Java Developers]を選択する
  4. ダイアログに従ってインストールする image.png

事象 : An illegal reflective access operation has occurred

  • 環境
    • macOS Big Sur バージョン11.0.1
    • openjdk version "11.0.8" 2020-07-14
    • Eclipse IDE for Enterprise Java Developers Version: 2020-12 M1 (4.18.0 M1)

新しいMacを買ったから久しぶりにダウンロードして展開して、おや?OSアップデートが出たからアップデートして〜さてEclipse起動・・・しない・・・メッセージすら表示されない・・・。

じゃ、ターミナルでクリーン起動してみると・・・ワーニングが・・・。

% /Applications/Eclipse_2020-12.app/Contents/MacOS/eclipse -clean
2020-11-16 23:01:32.099 eclipse[19742:71800] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_dismissFunctionRowItemTextInputViewWithReply:) block performed very slowly (1.47 secs).
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.osgi.internal.loader.ModuleClassLoader (file:/Applications/Eclipse_2020-12.app/Contents/Eclipse/plugins/org.eclipse.osgi_3.16.100.v20200904-1304.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of org.eclipse.osgi.internal.loader.ModuleClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

原因 : 不明

org.eclipse.osgi.internal.loader.ModuleClassLoaderで何かあったらしいけどよくわからない。警告だし見なかったことにする。

対応 : 警告を出ないようにする

# eclipse.iniに「--illegal-access」オプションで「deny」を指定する
% cat /Applications/Eclipse_2020-12.app/Contents/Eclipse/eclipse.ini | grep deny
--illegal-access=deny

# Eclipseを起動してもさっきの警告が出なくなる
% /Applications/Eclipse_2020-12.app/Contents/MacOS/eclipse -clean               
2020-11-16 23:21:55.868 eclipse[19826:80473] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_dismissFunctionRowItemTextInputViewWithReply:) block performed very slowly (1.50 secs).
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /Applications/Eclipse_2020-12.app/Contents/workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.0.20200318-1040.xml
org.eclipse.m2e.logback.configuration: Initializing logback
2020-11-16 23:23:49.086 eclipse[19826:80473] _TIPropertyValueIsValid called with 4 on nil context!

事象 : Failed setting boot class path.

  • 環境
    • Windows10 Pro 1909
    • openjdk version "11" 2018-09-25
    • Eclipse IDE for Enterprise Java Developers Version: 2020-09 (4.17.0)

EclipseのUpdateを促すダイアログメッセージがちょいちょい出ていたけど見なかったことにした。
ある日、うっかりダイアログをクリックしてアップデートを実行してしまった。
しかも、ほかのことの片手間にやっていてよく見ないで[OK]ボタン的なものをクリックして進めていた。
再起動を促されたのでボタンをクリックして再起動したら、一向に起動しない・・・しょうがないので手動で起動したら一瞬で消えた・・・。
a.gif
コマンドラインからeclipsec.exeで起動を試みるとエラーメッセージが出た。

C:\apps\pleiades\eclipse>eclipsec.exe
Error occurred during initialization of VM
Failed setting boot class path.

エラーメッセージググる・・・みつけるも・・・英語がよくわからない・・・
java - Setting up JDK containing only javac - Stack Overflow

原因 : eclipse.iniの-vmが変わっているから

色々見ていて気が付いた、eclipse.iniにこんなVM指定した覚えがない。

eclipse.ini
# ...省略...
-vm
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_14.0.2.v20200815-0932/jre/bin
# ...省略...

対応 : eclipse.iniの-vmで使いたいJavaを指定しなおす

eclipse.ini
# ...省略...
-vm
C:\apps\Java\jdk-11\bin\javaw.exe
# ...省略...

起動した・・・この辺の影響だろうか・・・

readme_pleiades_changes.txt
2020.03.22

・Java 14 が「インストール済みの JRE」に追加できない不具合を修正
・訳追加修正: Eclipse, EGit, Mark Text Editor, Buildship, Textmate, STS, Scala / Rider, DataGrip
  • 対策 : Updateの通知をしない
    • 通知がなければうっかりUpdateすることもない、必要になったら通知を出せばいいや
    • [Preferences] > [Install/Update] > [Automatic Updates] > [Automatically find new updates and notify me] > OFFimage.png

事象 : A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse.

  • 環境
    • Windows10 Pro 1909
    • openjdk version "11" 2018-09-25
    • Eclipse IDE for Enterprise Java Developers Version: 2020-09 (4.17.0)

起動しようとして怒られる
image.png

原因 : eclipse.iniの-vmの指定が誤っているから

eclipse.iniに-vmを指定する方法 - Qiita

eclipse.ini
-vm
/c/apps/Java/jdk-11/bin/java

対応 : Windowsの指定方法で指定する

eclipse.ini
-vm
C:\apps\Java\jdk-11\bin\javaw.exe

起動しないときの調査方法

pleiades\eclipse\readme\readme_pleiades.txt
FAQ
──────────────────────────────────────────────────

  Q. 起動しない / 動作が変 / 強制終了させたらおかしくなった(※)

    1. eclipse.ini に -Xverify:none を追加し忘れていないか確認してください。
    2. Eclipse 起動オプション -clean を指定して起動してみてください。
    3. <Pleiades キャッシュ・ディレクトリ> を削除して起動してみてください。
    4. コマンドラインから起動し、出力されるエラーを確認してください。Windows の場合は eclipse.exe
       ではなく eclipsec.exe を使用してください。<Pleiades キャッシュ・ディレクトリ>/pleiades.log、
       <ワークスペース>/.metadata/.log も確認してみてください。

    ※強制終了させた場合は、必ず -clean 起動してください。初回起動や -clean での起動はマシンによって
      は数分かかる場合があります。

<Pleiades キャッシュ・ディレクトリ>とはどこぞ?

java - Pleiades eclipseの日本語化機能を無効にする方法 - スタック・オーバーフロー

readme_pleiades.txtにも書いてある

pleiades\eclipse\readme\readme_pleiades.txt
  <Pleiades キャッシュ・ディレクトリ> の場所

    Windows C:/Users/(ユーザ名)/.<製品名+バージョン>/config/jp.sourceforge.mergedoc.pleiades/cache
    macOS   /Users/(ユーザ名)/Library/Preferences/<製品名+バージョン>/jp.sourceforge.mergedoc.pleiades/cache
    *nix    /home/(ユーザ名)/.<製品名+バージョン>/config/jp.sourceforge.mergedoc.pleiades/cache

コマンドラインから起動し、出力されるエラーを確認してください。

これ重要。

Windows の場合は eclipse.exeではなくeclipsec.exe を使用してください。

eclipse.iniの-vmの指定が意図しているかを確認する。

知らないものになっていたら、意図したものに書き換えてみる。

1
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
5