2

So far what I've tried is Launch4j which I did not have success making it work. Always getting java.lang.NoClassDefFoundError:

Is there a way build a shaded Jar into a Win32 executable (console app) with embedded JRE with Maven. So user would not have to install Java?

quarks
  • 33,478
  • 73
  • 290
  • 513
  • Did you try using a plugin for Launch4j? E.g.: http://stackoverflow.com/a/18954002/2492865 or https://github.com/lukaszlenart/launch4j-maven-plugin – Anton Koscejev Jun 02 '16 at 07:59

2 Answers2

1

You may use maven-shaded-plugin in combination with launch4j-maven-plugin

here is good example of this

Hisham Khalil
  • 1,054
  • 8
  • 9
1

I managed to fix the maven-shade-plugin with launch4j-maven-plugin and made it working by making sure the target jar is the shaded jar:

<jar>target/${project.artifactId}-${project.version}-shaded.jar</jar>

quarks
  • 33,478
  • 73
  • 290
  • 513