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
Trying this with Graal CE Java11/20.2.0 + GJF 1.9 I get the following error:
java.lang.IllegalStateException: Unknown Java version: 11
at com.google.googlejavaformat.java.Formatter.getMajor(Formatter.java:193)
at com.google.googlejavaformat.java.Formatter.format(Formatter.java:157)
at com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:291)
at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:267)
at com.google.googlejavaformat.java.FormatFileCallable.call(FormatFileCallable.java:45)
at com.google.googlejavaformat.java.FormatFileCallable.call(FormatFileCallable.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:834)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:517)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
I'm using File Watchers plugin for IntelliJ, which formats the current file when the file is saved or format all unsaved files when compiling. Anyway, formating a file is faster than formating with the google plugin, especially when dealing with big files.
So I followed your and it compiled but I get this error:
java.lang.IllegalStateException: Unknown Java version: 11
at com.google.googlejavaformat.java.Formatter.getMajor(Formatter.java:193)
at com.google.googlejavaformat.java.Formatter.format(Formatter.java:157)
at com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:291)
at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:267)
at com.google.googlejavaformat.java.FormatFileCallable.call(FormatFileCallable.java:45)
at com.google.googlejavaformat.java.FormatFileCallable.call(FormatFileCallable.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:834)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:517)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
This is with the released jar google-java-format-1.9-all-deps.jar Also tried verbatim your steps w/ a copy of master repo same error. I am building w/ Java 11 if that matters.
Activity
natros commentedon Mar 28, 2019
wow! realy fast formting.
in my case I had to pass -H:IncludeResourceBundles=org.openjdk.tools.javac.resources.compiler
natros commentedon Oct 30, 2019
graalvm 19.2.1
joprice commentedon May 29, 2020
This is great. Any reason it couldn't be the main distribution format?
perezd commentedon Sep 27, 2020
Trying this with Graal CE Java11/20.2.0 + GJF 1.9 I get the following error:
This was the command I used:
natros commentedon Sep 28, 2020
This is what I did (I'm using GraalVM Enterprise Edition 11-20.2.0 on macOS, should work with Comunity Edition)
First, I build the
google-java-format-1.10-SNAPSHOT-all-deps.jarwith java provided by graalvm.Then I selected a few projects and created a file
all.txtwith all java files:and did the same with few more projects.
Then inside
google-java-formatI didThis will create the json files with information for graalvm
And finally
Note: remove
-Dgraal.EnterprisePartialUnroll=truefor comunity editionI have a script that resumes what I did.
for the command line, I have 2 scripts:
java-formatand
java-format-changesI'm using File Watchers plugin for IntelliJ, which formats the current file when the file is saved or format all unsaved files when compiling. Anyway, formating a file is faster than formating with the google plugin, especially when dealing with big files.
perezd commentedon Oct 6, 2020
So I followed your and it compiled but I get this error:
This is with the released jar
google-java-format-1.9-all-deps.jarAlso tried verbatim your steps w/ a copy of master repo same error. I am building w/ Java 11 if that matters.GraalVM native-image Maven build support