Title: Using --release compiler option vs -source and -target · Issue #34 · scijava/pom-scijava-base · GitHub
Open Graph Title: Using --release compiler option vs -source and -target · Issue #34 · scijava/pom-scijava-base
X Title: Using --release compiler option vs -source and -target · Issue #34 · scijava/pom-scijava-base
Description: I ran into a problem with building BigVolumeViewer with JDK 11 (and Maven). pietzsch@mycroft:~/workspace/bigdataviewer/bigvolumeviewer-core (master)$ mvn clean install # 1 [15:22:38] [INFO] Scanning for projects... [INFO] [INFO] --------...
Open Graph Description: I ran into a problem with building BigVolumeViewer with JDK 11 (and Maven). pietzsch@mycroft:~/workspace/bigdataviewer/bigvolumeviewer-core (master)$ mvn clean install # 1 [15:22:38] [INFO] Scannin...
X Description: I ran into a problem with building BigVolumeViewer with JDK 11 (and Maven). pietzsch@mycroft:~/workspace/bigdataviewer/bigvolumeviewer-core (master)$ mvn clean install # 1 [15:22:38] [INFO] Scannin...
Opengraph URL: https://github.com/scijava/pom-scijava-base/issues/34
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using --release compiler option vs -source and -target","articleBody":"I ran into a problem with building BigVolumeViewer with JDK 11 (and Maven).\r\n\r\n```\r\npietzsch@mycroft:~/workspace/bigdataviewer/bigvolumeviewer-core (master)$ mvn clean install # 1 [15:22:38]\r\n[INFO] Scanning for projects...\r\n[INFO]\r\n[INFO] ----------------------\u003c sc.fiji:bigvolumeviewer \u003e-----------------------\r\n[INFO] Building BigVolumeViewer 0.3.2-SNAPSHOT\r\n[INFO] --------------------------------[ jar ]---------------------------------\r\n...\r\n[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ bigvolumeviewer ---\r\n[INFO] Compiling 103 source files to /Users/pietzsch/workspace/bigdataviewer/bigvolumeviewer-core/target/classes\r\n[INFO] /Users/pietzsch/workspace/bigdataviewer/bigvolumeviewer-core/src/main/java/bvv/vistools/BvvFunctions.java: Some input files use or override a deprecated API.\r\n[INFO] /Users/pietzsch/workspace/bigdataviewer/bigvolumeviewer-core/src/main/java/bvv/vistools/BvvFunctions.java: Recompile with -Xlint:deprecation for details.\r\n[INFO] -------------------------------------------------------------\r\n[ERROR] COMPILATION ERROR :\r\n[INFO] -------------------------------------------------------------\r\n[ERROR] /Users/pietzsch/workspace/bigdataviewer/bigvolumeviewer-core/src/main/java/bvv/core/blocks/ByteUtils.java:[36,16] package sun.misc does not exist\r\n[ERROR] /Users/pietzsch/workspace/bigdataviewer/bigvolumeviewer-core/src/main/java/bvv/core/blocks/ByteUtils.java:[41,30] cannot find symbol\r\n symbol: class Unsafe\r\n location: class bvv.core.blocks.ByteUtils\r\n[INFO] 2 errors\r\n[INFO] -------------------------------------------------------------\r\n...\r\n```\r\n\r\nThis can be traced back to the `maven-compiler-plugin` configuring `javac` with `--release 8`.\r\n\r\nThe problem is that `--release 8` works slightly different that the old-style `-source 1.8 -target 1.8`.\r\nSee https://bugs.openjdk.org/browse/JDK-8214165, https://bugs.openjdk.org/browse/JDK-8206937, https://mail.openjdk.org/pipermail/compiler-dev/2018-January/011583.html.\r\nThe spec for `--release N` is to provide access to the public documented API for `JDK N`. The `sun.misc` package is not public documented API.\r\n\r\nIronically, if we were targeting Java 11, there would be no problem. `--release 11` would work, because there is the `jdk.unsupported` module ...\r\n\r\nAnyway... I think this can be traced to\r\nhttps://github.com/scijava/pom-scijava-base/blob/8920b4fd8a74997dc245b7ce712e63b3a97dabd5/pom.xml#L2107-L2125\r\nwhere the `\u003cmaven.compiler.release\u003e` property is set.\r\n\r\nThe only way I found to fix that in BigVolumeViewer's pom.xml is https://github.com/bigdataviewer/bigvolumeviewer-core/commit/ffaf291987da4ea3e4ca9796a700b43c5209c8be\r\nhttps://github.com/bigdataviewer/bigvolumeviewer-core/blob/ffaf291987da4ea3e4ca9796a700b43c5209c8be/pom.xml#L83-L95\r\n\r\nIt would be nicer to address this higher up, but I don't know how pom-scijava-base should be changed exactly, and what side effects would be.\r\n","author":{"url":"https://github.com/tpietzsch","@type":"Person","name":"tpietzsch"},"datePublished":"2023-08-23T14:01:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/34/pom-scijava-base/issues/34"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eb8749a2-31a4-92d8-1144-8596dacdf6f8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9646:348DF0:3371DC5:457E87A:69708D5A |
| html-safe-nonce | 35efdef36e8292b1805b13e8906cce1f39cd49b1fb388096bad6a7f215e5c8fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjQ2OjM0OERGMDozMzcxREM1OjQ1N0U4N0E6Njk3MDhENUEiLCJ2aXNpdG9yX2lkIjoiODE2NTk0NjMxODYzOTg5Mzg1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a86d60e15a2ef4d9deaac55c34bdf0814d39ca7b7f304dcc0ea36a105b7de1ef |
| hovercard-subject-tag | issue:1863403772 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scijava/pom-scijava-base/34/issue_layout |
| twitter:image | https://opengraph.githubassets.com/74f590e7a2d9bd6179f0c4b815d4251fa942cad4db04912a88ca1f008115b80e/scijava/pom-scijava-base/issues/34 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/74f590e7a2d9bd6179f0c4b815d4251fa942cad4db04912a88ca1f008115b80e/scijava/pom-scijava-base/issues/34 |
| og:image:alt | I ran into a problem with building BigVolumeViewer with JDK 11 (and Maven). pietzsch@mycroft:~/workspace/bigdataviewer/bigvolumeviewer-core (master)$ mvn clean install # 1 [15:22:38] [INFO] Scannin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tpietzsch |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/scijava/pom-scijava-base git https://github.com/scijava/pom-scijava-base.git |
| octolytics-dimension-user_id | 1262770 |
| octolytics-dimension-user_login | scijava |
| octolytics-dimension-repository_id | 72131582 |
| octolytics-dimension-repository_nwo | scijava/pom-scijava-base |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 72131582 |
| octolytics-dimension-repository_network_root_nwo | scijava/pom-scijava-base |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width