-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with using indriya 2.1.3 as a module in Java 17 #377
Comments
We never heard any problems, maybe it did get stricter in Java 17 and the automatic module-name was removed by default. |
I have a feeling theres something I need to do in gradle that might make this work. Ill keep poking around. |
I havent found a workaround yet. However, it appears that you should switch to jakarta.inject-api (which has been modularized) and/or google "jakarta.inject-api vs javax.inject" |
I don't really have to google it, because I was among the driving Jakarta EE Spec Committee members to get these modularized ;-) |
Thanks I'll try that.
…On Tue, Jun 21, 2022, 11:20 AM Werner Keil ***@***.***> wrote:
I don't really have to google it, because I was among the driving Jakarta
EE Spec Committee members to get these modularized ;-)
It is a little strange Circle-CI never complained because the build
pipeline runs JDK 17.0.1 and must have used 17 for almost a year now and
never failed for that reason.
However the ServiceProvider since v2 of the API supports both, so I
changed it to Jakarta Inject 2.
Please check it out with the latest 2.1.4-SNAPSHOT or pull the latest code
and try it out.
—
Reply to this email directly, view it on GitHub
<#377 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEVZQHBO4XCSIIQTYURWW3VQH2WFANCNFSM5ZC7PNOA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I havent been able to get it to work by building on my machine. Its likely that my local build of indriya is wrong. I tried to hack it in with Java 17, since I dont use maven and unfamiliar with the multi jdk building. I can send you my pow.xml, but its probably better if I wait until you push 2.1.4-SNAPSHOT to maven, and I can test the real thing. |
It's already been deployed to https://oss.sonatype.org/content/repositories/snapshots/tech/units/indriya/2.1.4-SNAPSHOT/ |
currently failing with modules, see unitsofmeasurement/indriya#377 Move SimpleUnit facade from core to dataset. Add CalendarDateUnit.isDateUnit, remove from SimpleUnit.
Noticed a potentially related error when moving my library to Java 17; I strangely don't get this in the library's unit test (the library includes and uses Indriya), but in the implementing project that uses my library:
|
@GregJohnStewart It could be related, although there seems to be a remedy, see something like https://stackoverflow.com/questions/72411800/unable-to-make-field-private-static-final-jdk-internal-misc-unsafe-accessible-m. As we now replaced the old javax.inject with
including a module-info, the problem should be gone in the 2.1.4-SNAPSHOT. Did any of you have a chance to try that out? |
@keilw Okay thanks, good to know. I'll respond in the other thread |
Also, looks like there is still the same issue with Java 17 and serialization. I'll look into the jvm arg |
@GregJohnStewart The issue you're facing seems not directly related to the one here, the only thing they have in common is that they're both related to (unnamed) modules.
All explain a similar problem. And pretty much all of them suggest applying something like If that really should not help on top of 2.1.4 (which also removes the unnamed module for Dependency Injection, but chances are somewhere in your dependency chain you got more than one) please feel free to create another ticket, I'll close this one as the initial problem should be solved. |
Using Java 17, building with gradle, trying to make JPMS modules work. (works fine without modules)
If I add this to my module-info.java:
requires tech.units.indriya;
with
uomImpl = { group = "tech.units", name = "indriya", version = "2.1.3" }
I get an error:
I also notice that the jar artifact (javax.inject-1.jar on maven central):
javaxInject = { group = "javax.inject", name = "javax.inject", version = "1" }
has no module-info.java, or MANIFEST.MF, which AFAIU makes it unable to be used in a JPMS. (Did this used to work? Maybe this has gotten tighter in Java 17?).
Its very possible the problem is with me, as this is my first attempt to use JPMS.
The text was updated successfully, but these errors were encountered: