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

Unable to load ForwardDeclarationsKt when using Java modules #174

Open
LapisSea opened this issue Nov 8, 2021 · 2 comments
Open

Unable to load ForwardDeclarationsKt when using Java modules #174

LapisSea opened this issue Nov 8, 2021 · 2 comments

Comments

@LapisSea
Copy link

LapisSea commented Nov 8, 2021

The title pretty much says it all. When modules are enabled, imgui.static.ForwardDeclarationsKt can not be loaded and an NoClassDefFoundError exception is thrown.

Relevant stack trace:

java.lang.NoClassDefFoundError: imgui/static/ForwardDeclarationsKt
	at com.github.kotlin_graphics.imgui.core/imgui.classes.IO.<init>(IO.kt:136)
	at com.github.kotlin_graphics.imgui.core/imgui.classes.Context.<init>(Context.kt:34)
	at com.github.kotlin_graphics.imgui.core/imgui.classes.Context.<init>(Context.kt:27)
	at com.github.kotlin_graphics.imgui.core/imgui.classes.Context.<init>(Context.kt)

I am using java OpenJDK 17.0.1 and maven.

To produce the error all that is needed is

public static void main(String[] args){
	new Context();
}

and modules file

module your.module {
	requires com.github.kotlin_graphics.imgui.core;
}

I'm no modules expert but it looks like the imgui.static is not being exported in the core and that might be causing the issue.

@elect86
Copy link
Collaborator

elect86 commented Nov 8, 2021

Modules are giving me so much troubles I think I'm gonna disable them for the moment until everything mature a little more (Gradle + Java-Kotlin mixed project + JPMS)

I'll let you know

@LapisSea
Copy link
Author

LapisSea commented Nov 8, 2021

Thanks for the quick response!
Yes... modules are a pain in this sorts of environments. I share your pain.

Also if anyone else is reading this and the issue is not resolved by then, exception goes away when modules are disabled on the client (my) side so that is a solution if anyone else is in a pinch.

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

No branches or pull requests

2 participants