暇人の英語雑記ブログ

Eclipseエディタの「親リソースにアクセスできません」という警告の対処方法

2020.03.042018.08.06その他・雑記
solar-eclipse

Do you need an English explanation? Click here.

Eclipseエディタで新規プロジェクトを立ち上げようとしたときに以下のようなエラーに出会いました。

要素の作成に失敗しました。

理由:
プロジェクト説明の設定中に問題が発生しました。

‘ビルド・パスの設定’ に問題が発生しました。

リンクされたリソース ‘/.org.eclipse.dltk.core.external.folders/.link1’ を作成できません。親リソースにアクセスできません。


Problems encountered while setting project description.

Cannot create linked resource ‘/.org.eclipse.dltk.core.external.folders/.link1’. The parent resource is not accessible.

この警告は新しい workspaceディレクトリ(フォルダ)を作成し、そちらにプロジェクトを立ち上げることで回避することが可能です。

ただしこの方法ではインストール済みのプラグインや、シンタックスハイライトのカラー設定などが全て消滅してしまいます。

これではいけませんね。そこで以下の方法をとってください。

プロジェクトは workspace で管理されていることを前提とします

まず Eclipse を開いている場合は一度閉じましょう。

workspace-rename

そして workspace が存在しているフォルダへと行き、既存のものが使用されないよう、いったんリネームしてください。

上では workspace-bk としています。

そして次に workspace という名の空フォルダを作成します。

これで一度 Eclipse を立ち上げます。

eclipse-default
初期状態の Eclipse

たった今作成した空の workspaceフォルダが使用されるので、以上のような初期状態の UI で起動するはずです。

そしてこの状態で作成できなかったプロジェクトを再度作りましょう。ここで同様のエラーでコケるということは考えにくいです。

eclipse-new-project
新規プロジェクト完成

プロジェクトが完成したら Eclipse を閉じましょう。

in-the-new-workspace

次に先ほど作成した新しい workspace の中を見ると、作成した New Projectフォルダの横に .metadata というフォルダが存在します。

その中の .plugins に進みましょう。

eclipse-plugins-folder

そこに以下の2つのフォルダがあります。

  1. org.eclipse.core.resources
  2. org.eclipse.dltk.core

全く同様のものがリネーム(workspace-bk)したフォルダ内の/.metadata/.plugins以下にもあるので、それらを削除してこの新規のもので置き換えてください。

補足
試してはいませんが、置き換えるものは org.eclipse.dltk.core だけでいいかもしれません。

実行後は workspace を削除し、リネームしたフォルダの名前を workspace に戻しましょう。

では Eclipse 立ち上げ、再度プロジェクトを作成してみてください。

今回は上手くいくはずです。

個人でインストールしたプラグインのデータなどは全て .metadata の中に存在するので、この方法であれば自身の設定はそのままに「親リソースにアクセスできません」というエラーを回避することができます。


Sorry for my messy English. This is not my language. I am Japanese.

Apparently many people at home or abroad likewise encounter this issue. So I will add an English explanation here for you.

Let’s go!

When I tried to build a new project, this error denied me.

Problems encountered while setting project description.

Cannot create linked resource ‘/.org.eclipse.dltk.core.external.folders/.link1’. The parent resource is not accessible.

The easiest solution is to make another workspace and use it.

With this, however, all your installed plugins and color settings will vanish, which you will never be willing to accept.

Thereby I will give you another fix.

If Eclipse is open now, please close it.

workspace-rename

Go to the folder where workspace exists. And rename it to whatever you like (workspace-bk in the pic).

Make a new workspace folder in the same place.

Please open Eclipse now.

eclipse-default
Eclipse with the default status

This time the Editor uses the new empty workspace you just created. So all you see is the default interface.

eclipse-new-project
A new project created

Please build a new project in this. I believe you can this time.

After this, please close Eclipse.

in-the-new-workspace

Go see the new workspace and you’ll find the new project folder and .metadata in there.

Let’s get in /.metadata/plugins.

eclipse-plugins-folder

There are these 2 folders.

  1. org.eclipse.core.resources
  2. org.eclipse.dltk.core

The exact same folders also exist in the renamed workspace’s (workspace-bk) /.metadata/plugins.

Replace those with these new ones.

I did not try it, but maybe replacing only org.eclipse.dltk.core would do.

Now remove the new workspace altogether and rename the old one (workspace-bk) back to ‘workspace’.

Launch Eclipse now and create a new project.

You can do it, can’t you.

With this solution, you can retain installed plugins and all other settings since all data is in the .metadata folder.

Beautiful isn’t it?

author