Skip to content
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

The google-java-formatter eclipse plugin doesn't change the format of my code #1077

Open
gustabart opened this issue Mar 3, 2024 · 2 comments
Labels

Comments

@gustabart
Copy link

Hi,
I drop the google-java-format-eclipse-plugin-1.20.0.jar file in dropins eclipse folder.
I set google-java-formatter in my eclipse workspace and project configuration.
However, the formatter hasen't effect over my code.

I do Ctrl-Shift+F or from the contextual menu, but the java code format remains the same.

My eclipse version is:

Eclipse IDE for Java Developers (includes Incubating components)
Version: 2023-12 (4.30.0)
Build id: 20231201-2043
OS: Linux, v.5.14.0-1052-oem, x86_64 / gtk 3.24.33, WebKit 2.42.5
Java vendor: Eclipse Adoptium
Java runtime version: 21.0.2+13-LTS
Java version: 21.0.2

I tried too with previous versions of the formatter plugin but the same result.
I thing that got my attention was the Preview. All in a same line:
image

Thanks in advance!

@cushon cushon added the Eclipse label Mar 6, 2024
@schovjan
Copy link

Hi,
i have the same problom with latest version of STS(Version: 4.22.0.RELEASE, based on Eclipse 4.31.0.v20240229-1022) and GJF-1.21.0.

When I run STS via terminal, i don't see any errors when trying to format code.

Could we add Bug label to this issue?

@schovjan
Copy link

After I added these lines at the end of file SpringToolSuite4.ini it works :)

--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

founded at https://www.eclipse.org/forums/index.php/t/1112791/

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

No branches or pull requests

3 participants