René's URL Explorer Experiment


Title: Can't build native image with GraalVM 22.3.0 Java 17 CE · Issue #894 · google/google-java-format · GitHub

Open Graph Title: Can't build native image with GraalVM 22.3.0 Java 17 CE · Issue #894 · google/google-java-format

X Title: Can't build native image with GraalVM 22.3.0 Java 17 CE · Issue #894 · google/google-java-format

Description: A native image built via mvn -Pnative -DskipTests package with GraalVM 22.3.0 Java 17 CE fails at runtime with: MyClass.java: error: com.sun.tools.javac.parser.Tokens$TokenKind java.lang.NoClassDefFoundError: com.sun.tools.javac.parser.T...

Open Graph Description: A native image built via mvn -Pnative -DskipTests package with GraalVM 22.3.0 Java 17 CE fails at runtime with: MyClass.java: error: com.sun.tools.javac.parser.Tokens$TokenKind java.lang.NoClassDef...

X Description: A native image built via mvn -Pnative -DskipTests package with GraalVM 22.3.0 Java 17 CE fails at runtime with: MyClass.java: error: com.sun.tools.javac.parser.Tokens$TokenKind java.lang.NoClassDef...

Opengraph URL: https://github.com/google/google-java-format/issues/894

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't build native image with GraalVM 22.3.0 Java 17 CE","articleBody":"A native image built via `mvn -Pnative -DskipTests package` with GraalVM 22.3.0 Java 17 CE fails at runtime with:\r\n\r\n```\r\nMyClass.java: error: com.sun.tools.javac.parser.Tokens$TokenKind\r\njava.lang.NoClassDefFoundError: com.sun.tools.javac.parser.Tokens$TokenKind\r\n\tat com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:350)\r\n\tat com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:335)\r\n\tat com.google.googlejavaformat.java.JavaInput.\u003cinit>(JavaInput.java:277)\r\n\tat com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:260)\r\n\tat com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:247)\r\n\tat com.google.googlejavaformat.java.FormatFileCallable.call(FormatFileCallable.java:45)\r\n\tat com.google.googlejavaformat.java.FormatFileCallable.call(FormatFileCallable.java:26)\r\n\tat java.base@17.0.5/java.util.concurrent.FutureTask.run(FutureTask.java:264)\r\n\tat java.base@17.0.5/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\r\n\tat java.base@17.0.5/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\r\n\tat java.base@17.0.5/java.lang.Thread.run(Thread.java:833)\r\n\tat org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)\r\n\tat org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)\r\n```\r\n\r\nWhile this seems to be fixed by adding `-J--add-exports=...` `buildArgs` to the `native-maven-plugin` config, the produced native image still fails at runtime with a different error:\r\n\r\n```\r\nMyClass.java: error: com.google.googlejavaformat.java.java17.Java17InputAstVisitor. This exception was synthesized during native image building from a call to java.lang.Class.forName(String) with constant arguments.\r\njava.lang.LinkageError: com.google.googlejavaformat.java.java17.Java17InputAstVisitor. This exception was synthesized during native image building from a call to java.lang.Class.forName(String) with constant arguments.\r\n\tat com.google.googlejavaformat.java.Formatter.format(Formatter.java:162)\r\n\tat com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:271)\r\n\tat com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:247)\r\n\tat com.google.googlejavaformat.java.FormatFileCallable.call(FormatFileCallable.java:45)\r\n\tat com.google.googlejavaformat.java.FormatFileCallable.call(FormatFileCallable.java:26)\r\n\tat java.base@17.0.5/java.util.concurrent.FutureTask.run(FutureTask.java:264)\r\n\tat java.base@17.0.5/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\r\n\tat java.base@17.0.5/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\r\n\tat java.base@17.0.5/java.lang.Thread.run(Thread.java:833)\r\n\tat org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)\r\n\tat org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)\r\nCaused by: java.lang.ClassNotFoundException: com.google.googlejavaformat.java.java17.Java17InputAstVisitor. This exception was synthesized during native image building from a call to java.lang.Class.forName(String) with constant arguments.\r\n\tat com.google.googlejavaformat.java.Formatter.format(Formatter.java:157)\r\n\t... 10 more\r\n```\r\n\r\nI haven't found a fix for this yet.","author":{"url":"https://github.com/fmeum","@type":"Person","name":"fmeum"},"datePublished":"2023-02-12T15:15:45Z","url":"https://github.com/google/google-java-format/issues/894"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c516a3e2-c488-0745-69bf-4588f8abfa7e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC360:321C40:A14228:DCF5FC:6AFBDB10
html-safe-noncec16e78e5d10253d0b71ce46065336eb73070d97b6c2b865855b20a04c1ced416
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzYwOjMyMUM0MDpBMTQyMjg6RENGNUZDOjZBRkJEQjEwIiwidmlzaXRvcl9pZCI6IjcwOTU1OTk0OTAyMTk2MjkzMjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3c47681954dc3c292fc9b18abddd3f4c4a31f09d1dd47400fb871dad09272e88
hovercard-subject-tagissue:1581296478
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/google-java-format/894/issue_layout
twitter:imagehttps://opengraph.githubassets.com/58539b205cd533f8bc5d40b7bc368759c434a0444b7f3dbd3282906f3d2feb52/google/google-java-format/issues/894
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/58539b205cd533f8bc5d40b7bc368759c434a0444b7f3dbd3282906f3d2feb52/google/google-java-format/issues/894
og:image:altA native image built via mvn -Pnative -DskipTests package with GraalVM 22.3.0 Java 17 CE fails at runtime with: MyClass.java: error: com.sun.tools.javac.parser.Tokens$TokenKind java.lang.NoClassDef...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefmeum
hostnamegithub.com
expected-hostnamegithub.com
None18742cb872ec73544356e60359266b67aafece70c4ce008042e06227924cdd07
turbo-cache-controlno-preview
go-importgithub.com/google/google-java-format git https://github.com/google/google-java-format.git
octolytics-dimension-user_id1342004
octolytics-dimension-user_logingoogle
octolytics-dimension-repository_id35448780
octolytics-dimension-repository_nwogoogle/google-java-format
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id35448780
octolytics-dimension-repository_network_root_nwogoogle/google-java-format
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release820be804f18e1ef3940bd74a00d41d73d02e2b91
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/google/google-java-format/issues/894#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fgoogle-java-format%2Fissues%2F894
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fgoogle-java-format%2Fissues%2F894
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=google%2Fgoogle-java-format
Reloadhttps://github.com/google/google-java-format/issues/894
Reloadhttps://github.com/google/google-java-format/issues/894
Reloadhttps://github.com/google/google-java-format/issues/894
googlehttps://github.com/google
google-java-formathttps://github.com/google/google-java-format
Codehttps://github.com/google/google-java-format
Issues84 (84)https://github.com/google/google-java-format/issues
Pull requests35 (35)https://github.com/google/google-java-format/pulls
Actionshttps://github.com/google/google-java-format/actions
Projectshttps://github.com/google/google-java-format/projects
Wikihttps://github.com/google/google-java-format/wiki
Security and qualityhttps://github.com/google/google-java-format/security
Insightshttps://github.com/google/google-java-format/pulse
https://github.com/google/google-java-format
New issuehttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/894
New issuehttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/894
#1048https://github.com/google/google-java-format/pull/1048
Can't build native image with GraalVM 22.3.0 Java 17 CEhttps://github.com/google/google-java-format/issues/894#top
#1048https://github.com/google/google-java-format/pull/1048
https://github.com/fmeum
fmeumhttps://github.com/fmeum
on Feb 12, 2023https://github.com/google/google-java-format/issues/894#issue-1581296478
https://github.com/cushon
cushonhttps://github.com/cushon
on Feb 14, 2023https://github.com/google/google-java-format/issues/894#issuecomment-1430408909
vorburgerhttps://github.com/vorburger
on Feb 9, 2024https://github.com/google/google-java-format/issues/894#event-11760973140
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/f4a79ea2a4629c5f707b146b6fbe0d1136def722
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
f4a79eahttps://github.com/vorburger/google-java-format/commit/f4a79ea2a4629c5f707b146b6fbe0d1136def722
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/0373cd8ab9bdcb80cab6bb2f5016f0881c90651a
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
0373cd8https://github.com/vorburger/google-java-format/commit/0373cd8ab9bdcb80cab6bb2f5016f0881c90651a
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/e7732aa816673022ed0a795d7b07baf464efcc11
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
e7732aahttps://github.com/vorburger/google-java-format/commit/e7732aa816673022ed0a795d7b07baf464efcc11
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/ad87d2b3e45da982cd777a746f9eda1f609b0271
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
ad87d2bhttps://github.com/vorburger/google-java-format/commit/ad87d2b3e45da982cd777a746f9eda1f609b0271
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/b8908dc1456e350d78aee104cee4b0dac58fc80b
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
b8908dchttps://github.com/vorburger/google-java-format/commit/b8908dc1456e350d78aee104cee4b0dac58fc80b
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/31d5cb0098fb25628c5717282580410bcdfbb178
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
31d5cb0https://github.com/vorburger/google-java-format/commit/31d5cb0098fb25628c5717282580410bcdfbb178
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/081f57bdf6ae872b878e5f690fe09832ca942399
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
081f57bhttps://github.com/vorburger/google-java-format/commit/081f57bdf6ae872b878e5f690fe09832ca942399
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/3ad40948433ca2b1953f1f2e7143264239ee587f
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
3ad4094https://github.com/vorburger/google-java-format/commit/3ad40948433ca2b1953f1f2e7143264239ee587f
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/29434cdefa79266af1c6dc0317ce20854e9bc561
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
29434cdhttps://github.com/vorburger/google-java-format/commit/29434cdefa79266af1c6dc0317ce20854e9bc561
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/de507362d55c171791776e73ac268101479e1630
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
de50736https://github.com/vorburger/google-java-format/commit/de507362d55c171791776e73ac268101479e1630
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/acf07d0ffc612b16872fa71bafaed8b14f4ccf42
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
acf07d0https://github.com/vorburger/google-java-format/commit/acf07d0ffc612b16872fa71bafaed8b14f4ccf42
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/3c749bda85974644aaf4db85e97ec885cbee8847
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
3c749bdhttps://github.com/vorburger/google-java-format/commit/3c749bda85974644aaf4db85e97ec885cbee8847
Build native binary in CI (fixes google#894)https://github.com/vorburger/google-java-format/commit/852553f9d5dc1c79eee55e6d6605baf31819ec5b
google#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
852553fhttps://github.com/vorburger/google-java-format/commit/852553f9d5dc1c79eee55e6d6605baf31819ec5b
cushonhttps://github.com/cushon
completedhttps://github.com/google/google-java-format/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#1048https://github.com/google/google-java-format/pull/1048
on Feb 11, 2024https://github.com/google/google-java-format/issues/894#event-11768093285
cushonhttps://github.com/cushon
on Feb 11, 2024https://github.com/google/google-java-format/issues/894#event-11768093297
Build native binary in CI (fixes #894)https://github.com/google/google-java-format/commit/3d9c8fa1cd6eff1f3bd94c6e367501a622088d59
#894https://github.com/google/google-java-format/issues/894
https://docs.github.com/articles/closing-issues-via-commit-messages
3d9c8fahttps://github.com/google/google-java-format/commit/3d9c8fa1cd6eff1f3bd94c6e367501a622088d59
Sign up for freehttps://github.com/signup?return_to=https://github.com/google/google-java-format/issues/894
Sign in to commenthttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/894
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.