Skip to content

Commit bd71bd7

Browse files
committed
Require Java 21 for the Eclipse plugin and fix its install steps
1 parent 5cc6d72 commit bd71bd7

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎open-java-format-eclipse-plugin/README.md‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
## Installation
44

55
1. Run `./gradlew :open-java-format-eclipse-plugin:build` in the main folder,
6-
1. If running Eclipse under JRE 17 or later add these options to `eclipse.ini` after `-vmargs`:
6+
1. Eclipse has to run on Java 21 or later, as current Eclipse packages do. The formatter reaches into
7+
javac, so add these options to `eclipse.ini` after `-vmargs`:
78
```
8-
--add-exports
9-
jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
10-
--add-exports
11-
jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
12-
--add-exports
13-
jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
14-
--add-exports
15-
jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
16-
--add-exports
17-
jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
9+
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
10+
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
11+
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
12+
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
13+
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
1814
```
15+
Keep each option and its value on one line, joined by `=`: the Eclipse launcher starts the JVM
16+
inside its own process, and an option split over two lines does not take effect — formatting then
17+
fails with an `IllegalAccessError` in the workspace log.
1918
1. Copy `open-java-format-eclipse-plugin/build/libs/open-java-format-eclipse-plugin-<version>.jar` to the `dropins` folder of your Eclipse installation,
20-
1. Run `eclipse -clean`.
19+
1. Run `eclipse -clean`,
20+
1. Pick `open-java-format` in Window → Preferences (Eclipse → Settings on macOS) → Java → Code Style →
21+
Formatter → Formatter implementation.

‎open-java-format-eclipse-plugin/src/main/resources/META-INF/MANIFEST.MF‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: open-java-format
44
Bundle-SymbolicName: open-java-format-eclipse-plugin;singleton:=true
5-
Bundle-RequiredExecutionEnvironment: JavaSE-11
5+
Bundle-RequiredExecutionEnvironment: JavaSE-21
66
Import-Package: org.eclipse.jdt.core.dom,
77
org.eclipse.jdt.core.formatter,
88
org.eclipse.jface.text,

0 commit comments

Comments
 (0)