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

system jar not added to classpath #393

Open
lanny886 opened this issue Dec 15, 2021 · 12 comments
Open

system jar not added to classpath #393

lanny886 opened this issue Dec 15, 2021 · 12 comments
Assignees

Comments

@lanny886
Copy link

I want to add tools.jar in my project, so I use tag to make sure tools.jar can be added to app/lib, and also set to be true, when I run jfx:native first time, I found that lib/tools.jar not in manifest classpath, but when run jfx:native second time, it works.

@FibreFoX
Copy link
Member

Can you share a stripped down version of your pom.xml? That sounds very odd.

@lanny886
Copy link
Author

lanny886 commented Dec 15, 2021

Can you share a stripped down version of your pom.xml? That sounds very odd.

this is the plugin setting where I use and tools.jar is under src/main/additionalFiles/lib

<plugin>
                <groupId>com.zenjava</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>8.8.3</version>
                <configuration>
                    <vendor>xxx</vendor>
                    <mainClass>com.xxx.client.XXXApplication</mainClass>
                    <allPermissions>true</allPermissions>
                    <nativeReleaseVersion>${client-version}</nativeReleaseVersion>
                    <appName>xxx</appName>
                    <needShortcut>true</needShortcut>
                    <needMenu>true</needMenu>
                    <jvmArgs>
                        <argument>-Dglass.win.minHiDPI=1</argument>
                        <argument>-Xms512m</argument>
                        <argument>-Xmx4096m</argument>
                    </jvmArgs>
                    <bundleArguments>
                        <installdirChooser>true</installdirChooser>
                    </bundleArguments>
                    <manifestAttributes>
                        <Build-Time>${maven.build.timestamp}</Build-Time>
                        <Build-Label>${project.version}</Build-Label>
                    </manifestAttributes>
                    <additionalAppResources>src/main/additionalFiles/</additionalAppResources>
                    <useLibFolderContentForManifestClasspath>true</useLibFolderContentForManifestClasspath>
                </configuration>
            </plugin>

@lanny886
Copy link
Author

Can you share a stripped down version of your pom.xml? That sounds very odd.

the main tag I use are additionalAppResources and useLibFolderContentForManifestClasspath

@FibreFoX
Copy link
Member

Just to make sure, you are running mvn jfx:native twice? Or do you call other commands? Are your running this via some IDE?

@lanny886
Copy link
Author

Just to make sure, you are running mvn jfx:native twice? Or do you call other commands? Are your running this via some IDE?

I runing this via IntelliJ IDEA,when I run jfx:native first time,I found tools.jar under target\jfx\app\lib,but MANIFEST.MF in xxx-jfx.jar shows lib/tools.jar not in Class-Path tag, but when I run jfx:native once more, lib/tools.jar appears in the MANIFEST.MF

@lanny886
Copy link
Author

Just to make sure, you are running mvn jfx:native twice? Or do you call other commands? Are your running this via some IDE?

When before I run once more, I did not clean files generated by previous operation.

@FibreFoX
Copy link
Member

Just to make sure: what JDK are you using?

@lanny886
Copy link
Author

I use jdk1.8.0_311

@FibreFoX
Copy link
Member

So just to make sure this is some IDE-related bug, can you check running mvn jfx:native outside your IDE while your IDE is closed? I suspect the IDE doing some voodoo in the background. If you can re-check outside the IDE and find the same issue, then I have something I can check for.

@lanny886
Copy link
Author

I run mvn jfx:native in cmd when IDE is closed showing the same issue.

@lanny886
Copy link
Author

The code in JarMojo shows that useLibFolderContentForManifestClasspath is running before additionalAppResources in execute method, is it the reason for the first time jar was not added to classpath but works on the second time?

@FibreFoX
Copy link
Member

I am back from holiday family stuff 😺

Ah I see, yes, indeed, and initially there was reasoning behind it. I suspected such a thing. I will report back when I have some solution.

@FibreFoX FibreFoX self-assigned this Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants