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

Ubuntu run failure without wrapjar set to false #382

Open
2 tasks done
akhilmanikandan opened this issue Dec 4, 2023 · 6 comments
Open
2 tasks done

Ubuntu run failure without wrapjar set to false #382

akhilmanikandan opened this issue Dec 4, 2023 · 6 comments
Labels
question Further information is requested

Comments

@akhilmanikandan
Copy link

akhilmanikandan commented Dec 4, 2023

I'm submitting a…

  • bug report

Short description of the issue/suggestion:

DEB package for ubuntu not working when true

Steps to reproduce the issue/enhancement:

  1. Create DEB package for ubuntu without Wrapjar or wrapjar set to true
  2. Install the package in ubuntu
    3.running the executable yields following error

Error: An unexpected error occurred while trying to open file ##########

What is the expected behavior?

The deb file works with wrapjar set to true

What is the current behavior?

The package is not working with wrapped jar in executable

Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?

<plugin>
                <groupId>io.github.fvarrui</groupId>
                <artifactId>javapackager</artifactId>
                <version>1.7.5</version>
                <executions>
                    <execution>
                        <id>bundling-for-linux</id>
                        <phase>package</phase>
                        <goals>
                            <goal>package</goal>
                        </goals>
                        <configuration>
                            <mainClass>com.test.Main</mainClass>
                            <bundleJre>true</bundleJre>
                            <jrePath>./jre</jrePath>
                            <runnableJar>${project.build.directory}/${project.artifactId}-${project.version}-jar-with-dependencies.jar</runnableJar>

                            <linuxConfig>
                              **<wrapJar>false</wrapJar>**
                                <generateRpm>false</generateRpm>
                            </linuxConfig>
                            <platform>linux</platform>
                            <createTarball>true</createTarball>
                        </configuration>
                    </execution>
            </plugin>

What is the motivation / use case for changing the behavior?

want to package the jar inside the executable to hide the jar file from the user

Please tell us about your environment:

  • JavaPackager version: 1.7.5
  • OS version: ubuntu 22.04 jammy
  • JDK version: openjdk-11
  • Build tool:
    • Maven

Other information (e.g. related issues, suggestions how to fix, links for us to have context)

@fvarrui
Copy link
Owner

fvarrui commented Dec 13, 2023

Hi @akhilmanikandan!

I've been doing some tests with DEB package generation, trying with linuxConfig.wrapJar=true and false, and in both cases it worked like a charm.

So, do you mean that it fails when setting linuxConfig.wrapJar=true and only when is installed from DEB package? Have you tried to run your app directly from the generated app folder in target.

@fvarrui
Copy link
Owner

fvarrui commented Dec 13, 2023

The only thing I've not tried yet is using a customized fat jar. Maybe this could be the problem.

@fvarrui
Copy link
Owner

fvarrui commented Dec 13, 2023

I've just tested it using a fat jar without problems. If you are bundling all your dependencies in a fat jar, you should set copyDependencies=false.

@fvarrui fvarrui added the question Further information is requested label Dec 13, 2023
@akhilmanikandan
Copy link
Author

the problem seems to be size, if the fat jar is small it works, looks like exisiting issues with big jars in launch4j

https://sourceforge.net/p/launch4j/bugs/169/

@fvarrui
Copy link
Owner

fvarrui commented Dec 13, 2023

But your problem wasn't in Ubuntu?

Anyway, JP supports other kind of EXE files for Windows

@akhilmanikandan
Copy link
Author

issue is across ubuntu and windows , its the same issue, something to do with packaging, it works if i create a small fat jar and class not found when i create a fat jar above 120mb

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