You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The release page for version 1.7 does not contain an Eclipse plugin like the previous versions. The readme still mentions that page as the download source of the Eclipse plugin.
So please provide a JAR with the Eclipse plugin as part of the relase.
Please provide an official build in the GitHub release. I would like to be able to tell our project contributors to go there and download it.
Reacted by Stephan Schroevers, Kelvin Glaß, Arthur Baars, Christian Brüggemann, Philipp Wendler, Tony Bargnesi, Richard Kallay, Amos Lim, Kenny Wottrich, Aharon Hacmon and 9 more
The attached unofficial build for 1.7 above does not work when I attempt to install it in eclipse. eclipse does not appear to recognize it at all. When I tried the provided steps to reproduce I get a compile error
$ mvn install
[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: com.google.googlejavaformat:google-java-format-eclipse-plugin:1.7.0 @ /Users/wac84s/Downloads/google-java-format-master/eclipse_plugin/pom.xml
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/
[INFO] Adding repository http://download.eclipse.org/releases/mars
[INFO] Fetching p2.index from http://download.eclipse.org/technology/epp/packages/mars/
[INFO] Fetching p2.index from http://download.eclipse.org/technology/epp/packages/mars/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/201506241002/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/201506241002/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/201510021000/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/201510021000/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/201602261000/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/201602261000/
[INFO] Resolving dependencies of MavenProject: com.google.googlejavaformat:google-java-format-eclipse-plugin:1.7.0 @ /Users/wac84s/Downloads/google-java-format-master/eclipse_plugin/pom.xml
[INFO] Resolving class path of MavenProject: com.google.googlejavaformat:google-java-format-eclipse-plugin:1.7.0 @ /Users/wac84s/Downloads/google-java-format-master/eclipse_plugin/pom.xml
[INFO]
[INFO] ---< com.google.googlejavaformat:google-java-format-eclipse-plugin >----
[INFO] Building google-java-format Plugin for Eclipse 4.5+ 1.7.0
[INFO] ---------------------------[ eclipse-plugin ]---------------------------
[INFO]
[INFO] --- tycho-packaging-plugin:0.26.0:build-qualifier (default-build-qualifier) @ google-java-format-eclipse-plugin ---
[INFO] The project's OSGi version is 1.7.0
[INFO]
[INFO] --- tycho-packaging-plugin:0.26.0:validate-id (default-validate-id) @ google-java-format-eclipse-plugin ---
[INFO]
[INFO] --- tycho-packaging-plugin:0.26.0:validate-version (default-validate-version) @ google-java-format-eclipse-plugin ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ google-java-format-eclipse-plugin ---
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ google-java-format-eclipse-plugin ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/wac84s/Downloads/google-java-format-master/eclipse_plugin/src/main/resources
[INFO]
[INFO] --- tycho-compiler-plugin:0.26.0:compile (default-compile) @ google-java-format-eclipse-plugin ---
[INFO] Compiling 1 source file to /Users/wac84s/Downloads/google-java-format-master/eclipse_plugin/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.584 s
[INFO] Finished at: 2019-05-30T13:29:21-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.26.0:compile (default-compile) on project google-java-format-eclipse-plugin: Compilation failure: Compilation failure:
[ERROR] /Users/wac84s/Downloads/google-java-format-master/eclipse_plugin/src/com/google/googlejavaformat/java/GoogleJavaFormatter.java:[17]
[ERROR] import com.google.common.base.Preconditions;
[ERROR] ^^^^^^^^^^^^^^^^^
[ERROR] The import com.google.common cannot be resolved
[ERROR] /Users/wac84s/Downloads/google-java-format-master/eclipse_plugin/src/com/google/googlejavaformat/java/GoogleJavaFormatter.java:[18]
[ERROR] import com.google.common.collect.Range;
[ERROR] ^^^^^^^^^^^^^^^^^
...... truncted list. it is as if it does not see guava on classpath
I mean, did you unzip the jar out of the attached zip? I had to pack the jar inside a zip because of github file posting rules.
$ unzip -t google-java-format-eclipse-plugin-1.7.0.jar.zip
Archive: google-java-format-eclipse-plugin-1.7.0.jar.zip
testing: plugins/ OK
testing: plugins/google-java-format-eclipse-plugin_1.7.0.jar OK
No errors detected in compressed data of google-java-format-eclipse-plugin-1.7.0.jar.zip.
You need to put the plugins/google-java-format-eclipse-plugin_1.7.0.jar file in the eclipse dropins folder.
I unzipped and put in drop ins. It works for 1.6 (official download). Does not work for 1.7 unofficial download. I unzipped the file and placed the jar in correct place and restarted eclipse in-between. See attached screenshot. I am using eclipse oxygen3.a.
@wacaine I believe I built it with a later version than oxygen. I would suggest attempting to complete the build on your older version of eclipse as instructed above, and seeing if that produces a usable output jar.
@arifogel See my earlier post above with the output from the mvn install . It throws a ton of compiler errors not being able to find classes (missing guava classes). When I check the target folder no jar was built (because of the compile time issues).
org.eclipse.tycho:tycho-compiler-plugin:0.26.0:compile (default-compile) on project google-java-format-eclipse-plugin: Compilation failure: Compilation failure
I am not familiar with Tycho and how it resolves classpaths. Any suggestions or reference materials you can point me at? I am not clear on how to build against a different version of eclipse. From what I see it builds against the Eclipse Mars release which is older than Oxygen
Custom building an eclipse plugin does not seem to be a really good long term solution and also goes against the goal of having a simple formatter that an entire team can install and then not worry about. Just encountered this problem and found out it's a version issue.
Out of the box the intellij plugin and gradle plugin spotless use 1.7, which clashes with 1.6. I'd suggest it's really important then for the eclipse plugin to reach parity to avoid a problem of differing formatters.
Is there an ETA for when the eclipse 1.7 plugin would be available and the readme instructions updated?
Reacted by Philipp Wendler, David Carey, Liao James, Avi Mimoun, Alessandro Aiezza and Juan Cruz Fandino
of note, because I know it might help others after I dropped the .jar into my dropins folder, I still didn't ever see the items, even after eclipse and machine restart. when I ran eclipse via command line with eclipse -clean that made it show up.
The 1.7 release is now more than one year old, and there is still no build of the Eclipse plugin available.
Please provide an official build of the plugin or tell us if you will never do so such that we can look for alternate solutions (and remove the outdated plugin link from the readme in this case).
Reacted by William Caine, Alan C., Erik Pischel, Andrew January, DenisKnoepfle, alexpdp7, Felipe Pereira, David Trochel and gonzaloabeiro
Release 1.8 is out and I encountered the same problem when I ran a test (CLI, IntelliJ, Idea).
(By the time I find that the problem came from the version ...)
It is also impossible to generate the plugin by following this documentation : google-java-format Eclipse Plugin
For information, there is a pull request #465 which is currently in progress, and which could solve the problem.
In the meantime, has anyone found a solution to benefit from google-java-format 1.8 on eclipse?
@avim did you find a satisfactory solution for using Eclipse together with google style? I suppose your team used some Eclipse plugin together with the coveooss:fmt-maven-plugin in your own project: what did you use and what was your experience with this? What would you recommend? The build referenced here above, or something else?
I was waiting for the Eclipse plugin. The latest current version of the Eclipse plugin is 1.6.
The latest version of google-java-format is 1.8 (so the name of the issue already seems to be obsolete)
However, PR #465 is still pending merger and should resolve this issue.
Not being able to use the google-java-format version for Eclipse, I was able to use workarounds.
I give you my feedback. I try :
Google Actions: At each event (described in our configuration file), we check that the code is well formatted. If not, a bot will execute google-java-format and commit. This is a very good way to do it and allow a team to work on files that are necessarily formatted but cause an increase in commits (and the need to do git fetch). In addition, developers don't even have to use google-java-format locally.
The coveooss plugin: fmt-maven-plugin also works very well: It allows you to execute google-java-format by integrating into maven, so at each once we make a maven command, google-java-format is called. However, I was able to raise two constraints.
When a new release of google-java-format comes out, you have to wait for the update of fmt-maven-plugin
We don't always think about launching a maven command (if our IDE already does the work without going through maven)
Use a git hook: before each commit (for example), google-java-format is automatically called. Very practical because we directly control the version of google-java-format using the jar
A somewhat technical solution: place the jar (with all the dependencies) and use a script that executes google-java-format (in the project you want). A defect is that you have to remember to execute the script ...
Using git hooks is the most efficient way for me to work. We forget that we are using google-java-format
FTR (and in order to argue for the usefulness of the corresponding PR), none of these solutions seem great to me. I don’t like anything to re-format automatically behind the scenes; I think the re-format should be done where I code, and in such a way that I can see its consequences (e.g., in case something goes wrong, I can see it and act) before me committing. I also don’t want to force developers (or myself) to think about running maven “manually” (meaning, in a way that is not integrated in the IDE) on a regular basis. Finally, in a teaching context as I am, I find it important that student-developers understand the importance and the concept of formatting their code, and don’t want to automate this “too much” for them. As a consequence, I want some integration within Eclipse itself.
coveooss:fmt-maven-plugin is great but I’d use it only for checking that everything is properly formatted, for the above reason.
I guess I’ll wait that the corresponding PR gets merged, as I am not impatient enough to use a non-official build as proposed here above.
Unzip the zip file and put the jar file into the dropins folder. Works fine for me on Eclipse 2020-03.
Hey, So some of my team members are running the intellij plugin but I am using eclipse so I tried to use the jar file you provided. I am facing some issues trying to get this to work. I dropped in the jar file in the drop ins folder and did a eclipse -clean but the plug-in still was not showing up. So i opened an OSGi console and ran ss and I saw that the plug-in was installed but now resolved. After running the diag command in the console i get the following error-
The project I am trying to use the plug-in on, uses java 1.8 and I saw jdk 11 mentioned somewhere. Does this means that the plug-in won't be supported for projects below jdk 11 from now on. I thought that didn't make sense as my other team members on intellij are working on the same project as me and for them the plug-in works fine.
@ativ97 indeed, as the release notes for GJF 1.8 indicate the minimum supported runtime version is now JDK 11. Note that this means that the IDE/plugin needs to run on JDK 11, but the code base being formatted can target an earlier Java version.
For the impatient: google-java-format-eclipse-plugin-1.8.0.jar.zip is a build (using JDK14) of version 1.8.0, created out of this pull request: #465.
Unzip the zip file and put the jar file into the dropins folder. Works fine for me on Eclipse 2020-03.
This doesn't seem to work for 2020-09.
I would love it if the eclipse plugin worked the same as the coveo format maven plugin though! There are some slight differences in the output, and I'm assuming that bumping to version 1.8.0 will fix it.
Activity
arifogel commentedon Jan 18, 2019
I was able to build by following:
#190
https://github.com/google/google-java-format/blob/master/eclipse_plugin/README.md
My steps (use attached diff):
Then follow eclipse plugin build instructions starting at step 2.
build-ecliipse-plugin-from-release-1.7.diff.txt
arifogel commentedon Jan 18, 2019
I've attached a build using above instructions for convenience.
google-java-format-eclipse-plugin-1.7.0.jar.zip
PhilippWendler commentedon Jan 22, 2019
Please provide an official build in the GitHub release. I would like to be able to tell our project contributors to go there and download it.
Fix and enable the Eclipse plugin build
wacaine commentedon May 30, 2019
The attached unofficial build for 1.7 above does not work when I attempt to install it in eclipse. eclipse does not appear to recognize it at all. When I tried the provided steps to reproduce I get a compile error
arifogel commentedon May 30, 2019
From the above instructions:
Did you follow up that step with:
as indicated in that comment?
arifogel commentedon May 30, 2019
Also @wacaine this might be a stupid question, but did you unzip the jar first before placing the jar in the
dropinsfolder?arifogel commentedon May 30, 2019
I mean, did you unzip the jar out of the attached zip? I had to pack the jar inside a zip because of github file posting rules.
You need to put the
plugins/google-java-format-eclipse-plugin_1.7.0.jarfile in the eclipsedropinsfolder.wacaine commentedon May 30, 2019
I unzipped and put in drop ins. It works for 1.6 (official download). Does not work for 1.7 unofficial download. I unzipped the file and placed the jar in correct place and restarted eclipse in-between. See attached screenshot. I am using eclipse oxygen3.a.

arifogel commentedon May 30, 2019
@wacaine I believe I built it with a later version than oxygen. I would suggest attempting to complete the build on your older version of eclipse as instructed above, and seeing if that produces a usable output jar.
wacaine commentedon May 31, 2019
@arifogel See my earlier post above with the output from the mvn install . It throws a ton of compiler errors not being able to find classes (missing guava classes). When I check the target folder no jar was built (because of the compile time issues).
org.eclipse.tycho:tycho-compiler-plugin:0.26.0:compile (default-compile) on project google-java-format-eclipse-plugin: Compilation failure: Compilation failure
I am not familiar with Tycho and how it resolves classpaths. Any suggestions or reference materials you can point me at? I am not clear on how to build against a different version of eclipse. From what I see it builds against the Eclipse Mars release which is older than Oxygen
DanVanAtta commentedon Aug 22, 2019
Custom building an eclipse plugin does not seem to be a really good long term solution and also goes against the goal of having a simple formatter that an entire team can install and then not worry about. Just encountered this problem and found out it's a version issue.
The README instructions for installing goole java formatter are not consistent with itself, it has 1.7 dependencies yet the eclipse plugin is 1.6
Out of the box the intellij plugin and gradle plugin spotless use 1.7, which clashes with 1.6. I'd suggest it's really important then for the eclipse plugin to reach parity to avoid a problem of differing formatters.
Is there an ETA for when the eclipse 1.7 plugin would be available and the readme instructions updated?
ddellspe commentedon Nov 13, 2019
of note, because I know it might help others after I dropped the
.jarinto my dropins folder, I still didn't ever see the items, even after eclipse and machine restart. when I ran eclipse via command line witheclipse -cleanthat made it show up.PhilippWendler commentedon Jan 14, 2020
The 1.7 release is now more than one year old, and there is still no build of the Eclipse plugin available.
Please provide an official build of the plugin or tell us if you will never do so such that we can look for alternate solutions (and remove the outdated plugin link from the readme in this case).
av1m commentedon May 23, 2020
Release 1.8 is out and I encountered the same problem when I ran a test (CLI, IntelliJ, Idea).
(By the time I find that the problem came from the version ...)
It is also impossible to generate the plugin by following this documentation : google-java-format Eclipse Plugin
For information, there is a pull request #465 which is currently in progress, and which could solve the problem.
In the meantime, has anyone found a solution to benefit from google-java-format 1.8 on eclipse?
jan-z commentedon Jun 7, 2020
For the impatient: google-java-format-eclipse-plugin-1.8.0.jar.zip is a build (using JDK14) of version 1.8.0, created out of this pull request: #465.
Unzip the zip file and put the jar file into the dropins folder. Works fine for me on Eclipse 2020-03.
oliviercailloux commentedon Jul 14, 2020
@avim did you find a satisfactory solution for using Eclipse together with google style? I suppose your team used some Eclipse plugin together with the
coveooss:fmt-maven-pluginin your own project: what did you use and what was your experience with this? What would you recommend? The build referenced here above, or something else?av1m commentedon Jul 14, 2020
I was waiting for the Eclipse plugin. The latest current version of the Eclipse plugin is 1.6.
The latest version of
google-java-formatis 1.8 (so the name of the issue already seems to be obsolete)However, PR #465 is still pending merger and should resolve this issue.
Not being able to use the
google-java-formatversion for Eclipse, I was able to use workarounds.I give you my feedback. I try :
git fetch). In addition, developers don't even have to usegoogle-java-formatlocally.google-java-formatby integrating into maven, so at each once we make a maven command,google-java-formatis called. However, I was able to raise two constraints.google-java-formatcomes out, you have to wait for the update offmt-maven-plugingoogle-java-formatis automatically called. Very practical because we directly control the version ofgoogle-java-formatusing the jargoogle-java-format(in the project you want). A defect is that you have to remember to execute the script ...Using git hooks is the most efficient way for me to work. We forget that we are using
google-java-formatI also wrote a small note on this repository. It generally resumes what is written in the official repository.
I hope you are satisfied with this answer. cc @oliviercailloux
oliviercailloux commentedon Jul 14, 2020
Thanks a lot.
FTR (and in order to argue for the usefulness of the corresponding PR), none of these solutions seem great to me. I don’t like anything to re-format automatically behind the scenes; I think the re-format should be done where I code, and in such a way that I can see its consequences (e.g., in case something goes wrong, I can see it and act) before me committing. I also don’t want to force developers (or myself) to think about running maven “manually” (meaning, in a way that is not integrated in the IDE) on a regular basis. Finally, in a teaching context as I am, I find it important that student-developers understand the importance and the concept of formatting their code, and don’t want to automate this “too much” for them. As a consequence, I want some integration within Eclipse itself.
coveooss:fmt-maven-pluginis great but I’d use it only for checking that everything is properly formatted, for the above reason.I guess I’ll wait that the corresponding PR gets merged, as I am not impatient enough to use a non-official build as proposed here above.
ativ97 commentedon Aug 12, 2020
Hey, So some of my team members are running the intellij plugin but I am using eclipse so I tried to use the jar file you provided. I am facing some issues trying to get this to work. I dropped in the jar file in the drop ins folder and did a
eclipse -cleanbut the plug-in still was not showing up. So i opened an OSGi console and ranssand I saw that the plug-in was installed but now resolved. After running thediagcommand in the console i get the following error-osgi> diag 649 google-java-format-eclipse-plugin [649] Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=11))"The project I am trying to use the plug-in on, uses java 1.8 and I saw jdk 11 mentioned somewhere. Does this means that the plug-in won't be supported for projects below jdk 11 from now on. I thought that didn't make sense as my other team members on intellij are working on the same project as me and for them the plug-in works fine.
Any help will be appreciated!
Stephan202 commentedon Aug 12, 2020
@ativ97 indeed, as the release notes for GJF 1.8 indicate the minimum supported runtime version is now JDK 11. Note that this means that the IDE/plugin needs to run on JDK 11, but the code base being formatted can target an earlier Java version.
aaiezza commentedon Sep 28, 2020
This doesn't seem to work for 2020-09.
I would love it if the eclipse plugin worked the same as the coveo format maven plugin though! There are some slight differences in the output, and I'm assuming that bumping to version 1.8.0 will fix it.
sarguin-lacapitale commentedon Mar 4, 2021
Please provide Eclipse plugin in version 1.9
PhilippWendler commentedon Aug 2, 2021
Big thanks @cushon for building and uploading version 1.11.0 of the Eclipse plugin!
This resolves this issue, but you might want to update the link to the Eclipse plugin in the README?
av1m commentedon Aug 2, 2021
@PhilippWendler check #639
cushon commentedon Aug 2, 2021
https://github.com/google/google-java-format/releases/tag/v1.11.0