Skip to content

Eclipse plugin does not seem to work #1076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ratondeau opened this issue Apr 18, 2024 · 6 comments
Open

Eclipse plugin does not seem to work #1076

ratondeau opened this issue Apr 18, 2024 · 6 comments

Comments

@ratondeau
Copy link

What happened?

I build the eclipse plugin and moved the jar to the proper location to the dropins folder but I cannot find a way to activate the plugin or do perform any code formatting like in IntelliJ. In eclipse I only see the default code format settings Eclipse Build-in etc. . What am I missing?

What did you want to happen?

Palantir-Java-Format should be activated and used globally so that it also will be used on save actions etc.

@mhagnumdw
Copy link

Same here.

Eclipse
Version: 2023-06 (4.28.0)
Build id: 20230608-1333

@brychcy
Copy link

brychcy commented Jun 28, 2024

Maybe you looked at the wrong setting? You have to enable the formatter implementation, not change the format settings, which are ignored anyway. This is a bit hard to find.

On the Preferences > Java Code Style > Java > Code Style > Formatter page, there is a little menu "Formatter implemention" for it.

(You can also do it in the project specific settings Java Code Style > Formatter)

@lucas-mpc-brant
Copy link

What is the correct configuration in the formatter page? Despite selecting palantin-java-format as the formatter implementation, it seems active profile still overrides the formatting somewhat.

@cmad9901
Copy link

cmad9901 commented Jul 9, 2024

maybe not the right issue, but get errors on Save, from the formatter...

com.palantir.javaformat.java.java14.Java14InputAstVisitor cannot be found by palantir-java-format-eclipse-plugin_2.38.0. See the error log for details

Eclipse with Java 17, have set all the JVM args i've seen in other threads that supposedly fix this. I have Google formatter plugin working, but the palantir plugin still fails.

@beuss
Copy link

beuss commented Jan 23, 2025

@cmad9901 This happens when you build the plugin using a pre-14 JDK, the class is excluded from package but still used on runtime
This thread is rather old but maybe this can be useful to somebody
Here I managed to get a working installation by

  • checkouting 2.50.0 (develop HEAD wasn't building)
  • ./gradlew eclipse_plugin:build
  • copy eclipse_plugin/build/libs/whatever.jar in $ECLIPSE_DIR/dropins
  • modify eclipse.ini to add following entries after -vmargs
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
  • selecting proper formatter implementation in java code style
  • Activate save actions to format whole file on save (doesn't seem to work on partial formating

You'll also have to tune Eclipse import organisation to keep only two groups, one for static imports the other for non-static ones and raise wildcard limits to 99

@wtobi
Copy link

wtobi commented Feb 27, 2025

For me, the solution was to build the plugin from the latest release tag (in my case, 2.55.0) instead of from develop HEAD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants