Skip to content

Unable to load ForwardDeclarationsKt when using Java modules #174

@LapisSea

Description

@LapisSea

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions