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

Bug: Maven fat jar not working on windows #195

Open
danilolr opened this issue Aug 14, 2023 · 1 comment
Open

Bug: Maven fat jar not working on windows #195

danilolr opened this issue Aug 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@danilolr
Copy link

Version

1.86.10

What happened?

When running the fat jar on windows I got the message "no imgui-java on java.library.path"

Reproduction

I have a imgui-java with ImGui with this POM :

`


4.0.0

<groupId>org.example</groupId>
<artifactId>game-imgui</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>io.github.spair</groupId>
        <artifactId>imgui-java-app</artifactId>
        <version>1.86.10</version>
    </dependency>
    <dependency>
        <groupId>com.github.bhlangonijr</groupId>
        <artifactId>chesslib</artifactId>
        <version>1.3.3</version>
    </dependency>
    <dependency>
        <groupId>org.l33tlabs.twl</groupId>
        <artifactId>pngdecoder</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>
<build>
    <finalName>game-imgui</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.1.1</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <archive>
                <manifest>
                    <mainClass>org.example.Main</mainClass>
                </manifest>
                </archive>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
`

I can build the fat jar with mvm package.
On my linux dev machine it works fine using :

java -jar game-imgui-jar-with-dependencies.jar

But running the same command on windows 10 gives the error :

eim

I think it has relation with the load of native code on /windows subdirectory..
I tried some advice like https://stackoverflow.com/questions/12036607/bundle-native-dependencies-in-runnable-jar-with-maven but without success.

Relevant log output

No response

@danilolr danilolr added the bug Something isn't working label Aug 14, 2023
@enesaltinkaya
Copy link

I think you need add natives-windows dependency.

<dependency>
    <groupId>io.github.spair</groupId>
    <artifactId>imgui-java-natives-windows</artifactId>
    <version>1.86.10</version>
</dependency>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants