Skip to content
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

Failed to check JDK distribution: 'jpackage' is missing #709

Closed
crowforkotlin opened this issue Nov 28, 2024 · 4 comments
Closed

Failed to check JDK distribution: 'jpackage' is missing #709

crowforkotlin opened this issue Nov 28, 2024 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@crowforkotlin
Copy link

crowforkotlin commented Nov 28, 2024

I use jewel in my project, which requires jbrsdk+jcef but I see that jbr doesn't have jpackage, so when I use ./gradlew packageDmg, I get an error!
image
Is there a way around this?

Jewel must be run with jbr, but jbr does not have jpackage. I cannot package it on Mac. If I force the packaged product, it will not run.

@rock3r
Copy link
Collaborator

rock3r commented Nov 28, 2024

I think it's fine to use different JDKs to build and run, if that is the question.

@rock3r rock3r self-assigned this Nov 28, 2024
@rock3r rock3r added the question Further information is requested label Nov 28, 2024
@crowforkotlin
Copy link
Author

crowforkotlin commented Nov 28, 2024

I think it's fine to use different JDKs to build and run, if that is the question.

image

It can be packaged, but it will crash when running. JBR must be used. I use jbr on the Windows desktop. If I change to other jdk, the packaging will also fail? I seem to remember this error java.lang.IllegalStateException: DecoratedWindow can only be used on JetBrainsRuntime (JBR) platform

At present, I can package on Windows, using jbr, and it runs normally, but on Mac, I need to use jpackage, I checked all jdk17 packages of jbr and found that jbr does not exist jpackage

Executing tasks: [desktopRun] in project /Users/crowforkotlin/AndroidStudioProjects/ModicaiX-main/composeApp

SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
Exception in thread "main" java.lang.IllegalStateException: DecoratedWindow can only be used on JetBrainsRuntime(JBR) platform, please check the document https://github.com/JetBrains/jewel#int-ui-standalone-theme
	at org.jetbrains.jewel.window.DecoratedWindowKt.DecoratedWindow(DecoratedWindow.kt:65)
	at com.crow.mordecaix.ComposableSingletons$MainKt$lambda-3$1$2$1.invoke(Main.kt:53)
	at com.crow.mordecaix.ComposableSingletons$MainKt$lambda-3$1$2$1.invoke(Main.kt:52)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:401)
	at androidx.compose.material3.TextKt.ProvideTextStyle(Text.kt:349)
	at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:69)
	at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:68)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380)
	at androidx.compose.material3.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:60)
	at com.crow.mordecaix.ui.theme.MordecaiXThemeKt.MordecaiXTheme(MordecaiXTheme.kt:50)
	at com.crow.mordecaix.ui.theme.MordecaiXThemeKt.MordecaiXTheme(MordecaiXTheme.kt:42)
	at com.crow.mordecaix.ComposableSingletons$MainKt$lambda-3$1$2.invoke(Main.kt:52)
	at com.crow.mordecaix.ComposableSingletons$MainKt$lambda-3$1$2.invoke(Main.kt:51)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at org.jetbrains.jewel.intui.standalone.theme.IntUiThemeKt$IntUiTheme$2$1.invoke(IntUiTheme.kt:240)
	at org.jetbrains.jewel.intui.standalone.theme.IntUiThemeKt$IntUiTheme$2$1.invoke(IntUiTheme.kt:239)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380)
	at org.jetbrains.jewel.intui.standalone.theme.IntUiThemeKt$IntUiTheme$2.invoke(IntUiTheme.kt:236)
	at org.jetbrains.jewel.intui.standalone.theme.IntUiThemeKt$IntUiTheme$2.invoke(IntUiTheme.kt:235)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380)
	at org.jetbrains.jewel.ui.theme.JewelThemeKt$BaseJewelTheme$2$1.invoke(JewelTheme.kt:151)
	at org.jetbrains.jewel.ui.theme.JewelThemeKt$BaseJewelTheme$2$1.invoke(JewelTheme.kt:150)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380)
	at org.jetbrains.jewel.ui.theme.JewelThemeKt$BaseJewelTheme$2.invoke(JewelTheme.kt:150)
	at org.jetbrains.jewel.ui.theme.JewelThemeKt$BaseJewelTheme$2.invoke(JewelTheme.kt:149)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380)
	at org.jetbrains.jewel.foundation.theme.JewelThemeKt.JewelTheme(JewelTheme.kt:57)
	at org.jetbrains.jewel.foundation.theme.JewelThemeKt$JewelTheme$1.invoke(JewelTheme.kt:52)
	at org.jetbrains.jewel.foundation.theme.JewelThemeKt$JewelTheme$1.invoke(JewelTheme.kt:52)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:401)
	at org.jetbrains.jewel.foundation.theme.JewelThemeKt.JewelTheme(JewelTheme.kt:52)
	at org.jetbrains.jewel.ui.theme.JewelThemeKt.BaseJewelTheme(JewelTheme.kt:149)
	at org.jetbrains.jewel.intui.standalone.theme.IntUiThemeKt.IntUiTheme(IntUiTheme.kt:235)
	at com.crow.mordecaix.ComposableSingletons$MainKt$lambda-3$1.invoke(Main.kt:43)
	at com.crow.mordecaix.ComposableSingletons$MainKt$lambda-3$1.invoke(Main.kt:32)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:116)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.ui.window.Application_desktopKt$application$1$1.invoke(Application.desktop.kt:117)
	at androidx.compose.ui.window.Application_desktopKt$application$1$1.invoke(Application.desktop.kt:116)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:116)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1$1.invoke(Application.desktop.kt:233)
	at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1$1.invoke(Application.desktop.kt:232)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380)
	at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1.invoke(Application.desktop.kt:223)
	at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1.invoke(Application.desktop.kt:221)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
	at androidx.compose.runtime.ActualJvm_jvmKt__ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:36)
	at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(Unknown Source)
	at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3595)
	at androidx.compose.runtime.ComposerImpl.composeContent$runtime(Composer.kt:3522)
	at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:743)
	at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:1122)
	at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:649)
	at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:635)
	at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:221)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':composeApp:desktopRun'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3s

image

@rock3r
Copy link
Collaborator

rock3r commented Nov 28, 2024

You need to package with another JDK, and still run with JBR.

We don't have the capacity to offer support for other libraries, tools, and technologies, unfortunately. I'd recommend you consulting the appropriate documentation (for jpackage etc) to see how this could be done.

When it's finally fully working, you can also look at #289 — however, that is only an example on how you could do your packaging and distribution and is provided as a reference with no support, either.

@crowforkotlin
Copy link
Author

Collaborator

kaleidot725/AdbPad#106
The same question has not yet been completely solved. I don't know how to package the cross-compiled library. This problem occurs when using gradlew packageDmg and has not been completely solved. But I replaced it with another open source library for packaging on Mac, "dev.hydraulic.conveyor:conveyor-control", and now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants