私のプロジェクトのコンパイラに--patchモジュールjavacのオプションを渡すことで、JDK 9+にEclipseのコンパイルパッチを適用したモジュールを作成する方法?(写真を参照)

エディ・ブラボー:

EclipseはJDKのjavacは、クリアランスのためにCIAに連絡するために私を必要とせずに、それを可能にするので、それを可能にしています。日食がそれを許可しない場合は、他のJava IDEは、私を許すだろうか。最悪のシナリオは、私はEmacsと、端末を使用します。

スクリーンショット: ここでは、画像の説明を入力します。

ステファンハーマン:

関連する情報のほとんどは、すでにコメントで与えられている、私は主に少し背景といくつかのリンクでそれを合計しています

Firstly, Eclipse does not accept a folder named java.base within your source folder. Such layout is used by javac's multi-module mode, but in an IDE like Eclipse that mode is not needed, since we have projects for grouping the modules. In particular Eclipse requires that each project contains at most one module. Now you are free to either (a) define src/main/java/java.base as a source folder, or (b) move its content one level up (so that packages start directly in src/main/java as in the olden days).

Secondly, for setting up options like --patch-module the UI has been revamped in Eclipse 2019-06, so I suggest to upgrade Eclipse (if not already done). Then you will find a new tab in the Java Build Path configuration dialog called "Module Dependencies" where you can mark your project as patching java.base. (The method from older versions of Eclipse was: find a node "Is Modular" below the library you want to patch and edit (double click) its details. This mode is still supported for a migration period, but it is no longer recommended).

第三に、(名前が示すように:))コンパイル/ビルドするために使用されるJavaのビルド・パスも、起動のために尊重されるべきです。必ずコンパイル時ということにすると、実行時オプションの同じセットを表示するには、両方のダイアログ(Javaのビルド・パスファイル名を指定して実行などが...)ビルド・パスの構成でJPMSオプションと呼ばれるように構成オプション(のテキスト形式を示すためのボタンがあります)。

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=335879&siteId=1