Skip to content

Running palantir-java-format from the command line #1513

@xjrga

Description

@xjrga

Ran this code and got the message below. I am not sure what I am missing. Thanks.

java \
--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 \
--class-path \
palantir-java-format-spi-2.83.0.jar:\
palantir-java-format-2.83.0.jar:\
guava-33.5.0-jre.jar:\
jackson-core-2.20.1.jar:\
jackson-databind-2.20.1.jar:\
jackson-datatype-guava-2.20.1.jar:\
jackson-annotations-3.0-rc5.jar:\
#tmp \
com.palantir.javaformat.java.Main \
Main.java

Main.java: error: fj/F
java.lang.NoClassDefFoundError: fj/F
at com.palantir.javaformat.doc.HasUniqueId.ord(HasUniqueId.java:37)
at com.palantir.javaformat.doc.State.startingState(State.java:87)
at com.palantir.javaformat.OpsBuilder.build(OpsBuilder.java:658)
at com.palantir.javaformat.java.Formatter.format(Formatter.java:146)
at com.palantir.javaformat.java.Formatter.getFormatReplacements(Formatter.java:322)
at com.palantir.javaformat.java.Formatter.formatSource(Formatter.java:299)
at com.palantir.javaformat.java.FormatFileCallable.formatFile(FormatFileCallable.java:84)
at com.palantir.javaformat.java.FormatFileCallable.call(FormatFileCallable.java:72)
at com.palantir.javaformat.java.FormatFileCallable.call(FormatFileCallable.java:31)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: java.lang.ClassNotFoundException: fj.F
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions