Comments (26)
yes it is. i miss it during my anonymisation. can you edit your post to remove it ? thx.
I absolutly not understand why its working in allinone jar when i run it in netbeans i have to specify the main class paht as arg :
-classpath %classpath com.organisation.mavenproject3.Main
from javapackager.
Ok! I’ve been making changes trying to build and release the plugin with Gradle. I’ll try to build it on a brand new virtual machine to reproduce your problem
from javapackager.
the build and the publish work but i have some jni error when i execute my jar/exe i will investigate.
thx for your quick fix by the way.
from javapackager.
Hi @HumanG33k!
Can you share mvn package
, mvn -v
and exe output, please?
from javapackager.
Hi again!
Here you can find a sample project using a runnable fat jar, using same plugin options as yours.
https://github.com/fvarrui/HelloWorld
from javapackager.
hi,
sry for waiting and thx to check my issue and try to help.
build is quite long + i try to do anomymisation on files.
Has you will see its not a small project. I already read example and some already closed issues. I probably miss somethings.
version.log
package.log
I m aware about the fact 13 is already dead. (F*cking stupid 6 months release )
from javapackager.
Ok! It seems that you are executing the plugin múltiple times, but If I’m not wrong, each execution removes the previous generated app. I know this is not the problem, but I have to warn you. Take a look at this link!
Can you confirm to me that com.organization.mavenproject3.Main
is your main class? (Sorry, but I have to ask you)
Don’t worry about 13, I’m using too!! I’m too lazy to update it
from javapackager.
do you know if something similar is possible with javapacker or if my error can be related to that ?
from javapackager.
You can specify VM arguments to javapackager using vmArgs
option.
I’ve seen that launch4j fails with too fat jars. Can you try your jar with launch4j in standalone mode?
from javapackager.
For launch4j :
The standalone launch4j says it need 1.6 -1.8 jre.
So i had the java 8 (install it) because i only have the openjdk 13 install.
I do it works (l4j starts)
I try to build the exe and this configuration file permit to start it :
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>true</dontWrapJar>
<headerType>gui</headerType>
<jar>project-1.0-SNAPSHOT.jar</jar>
<outfile>D:\USER\Projects\USER_tmp\Project\target\project.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl>https://adoptopenjdk.net/</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<manifest></manifest>
<icon></icon>
<classPath>
<mainClass>com.organisation.mavenproject3.Main</mainClass>
<cp>%classpath com.organisation.mavenproject3.Main</cp>
</classPath>
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion>11</minVersion>
<maxVersion>14</maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
</launch4jConfig>
i guess error come from the cp option.
Can i specify it on javapacker ?
from javapackager.
I see that you have configured the property dontWrapJar
to true
, so jar is not included inside the exe file. This is a proposed solution when using very large jar files with launch4j. Maybe is this the difference?
from javapackager.
And, no, you can’t specify cp
option for launch4j right now, but it’s possible to include mainclass in cp
by default or include a new plugin option. I don't think adding it affects other developers
from javapackager.
I've added mainclass to classpath by default to launch4j and published to 1.1.1-SNAPSHOT. Can you give it a try?
⚠️ You have to install the plugin manually in your local repo:git clone https://github.com/fvarrui/JavaPackager cd JavaPackager gradlew clean build publishToMavenLocal
from javapackager.
hello,
sry i have been busy, i try but i have an error with the main class for the gradlew.bat
I guess it s because gradle jar are not in the project directory.
so i try a
gradle wrapper
but i have an error, the --info says
* Where:
Build file 'JavaPackager\build.gradle' line: 189
* What went wrong:
A problem occurred evaluating root project 'javapackager'.
> Could not get unknown property 'ossrhUser' for NexusStagingExtension(serverUrl:https://oss.sonatype.org/service/local/, username:null, password:null, packageGroup:null, stagingProfileId:null, numberOfRetries:7, delayBetweenRetriesInMillis:1000) of type io.codearte.gradle.nexus.NexusStagingExtension.
So i "fix" it by commenting the part in build.gradle and relaunch the command.
After that i retry the following command
and a new error occur :
> Task :generatePluginDescriptor
[main] INFO org.apache.maven.cli.MavenCli - Error stacktraces are turned on.
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD FAILURE
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 0.479 s
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: 2020-07-15T10:37:17+02:00
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] ERROR org.apache.maven.cli.MavenCli - Plugin org.apache.maven.plugins:maven-plugin-plugin:3.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-plugin-plugin:jar:3.4: Could not transfer artifact org.apache.maven.plugins:maven-plugin-plugin:pom:3.4 from/to central (https://repo.maven.apache.org/maven2): No connector factories available -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-plugin-plugin:3.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-plugin-plugin:jar:3.4
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:120)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:182)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:286)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:244)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:239)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:104)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:182)
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-plugin-plugin:jar:3.4
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:255)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:171)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:255)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:106)
... 14 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-plugin-plugin:pom:3.4 from/to central (https://repo.maven.apache.org/maven2): No connector factories available
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:424)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:207)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:240)
... 17 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-plugin-plugin:pom:3.4 from/to central (https://repo.maven.apache.org/maven2): No connector factories available
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:506)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:401)
... 20 more
Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: No connector factories available
at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:168)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:496)
... 21 more
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - Re-run Maven using the -X switch to enable full debug logging.
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - For more information about the errors and possible solutions, please read the following articles:
[main] ERROR org.apache.maven.cli.MavenCli - [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
> Task :generatePluginDescriptor FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generatePluginDescriptor'.
> Process 'command 'C:\Program Files\AdoptOpenJDK\jdk-14.0.1.7-hotspot\bin\java.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
from javapackager.
@fvarrui did you test in virtual machine ? I really curious about if this problem came from my setup.
from javapackager.
Hi @HumanG33k!
I've just tested in a VM and managed to reproduce your issues:
- Gradle jar was not included in
.gitignore
by mistake 😅 ... it's already uploaded to the repo. - It took
ossrhUser
andossrhPassword
properties from$HOME/.gradle/gradle.properties
file, needed to release the plugin to Maven Central, but not to release to your local repo .... so, now if these properties are not found because this file doesn't exist, it uses empty strings, so it doesn't fail. - Some dependencies needed for maven-embeder were missing, so it couldn't download dependencies from Maven Central. I didn't experience these problems because I already had such dependencies in my local Maven repository.
I hope now you can build and publish SNAPSHOT version to your local repo.
from javapackager.
Maybe it could be related to this Launch4j issue.
I could add a new property to choose if JAR has to be wrapped into EXE or stay next to it, if this is the problem.
from javapackager.
it's probably the case.
i think you already did that work but you should have
- an association table for common option (behavior is probably more appropriate)
- a way to specify option by sub tools
- and if time use your tool for already existing java libre software for add more test cases and promote your tool which is really cool at global project scope.
Also for my previous test program, exe are well generated but not find the main class even if my jar work with simple
java -jar myfat.jar
from javapackager.
it's probably the case.
i think you already did that work but you should have
- an association table for common option (behavior is probably more appropriate)
There are a samples page, with different use cases. I have to add more.
- a way to specify option by sub tools
I’m not sure what you mean.
- and if time use your tool for already existing java libre software for add more test cases and promote your tool which is really cool at global project scope.
Good idea!! Thanks
Also for my previous test program, exe are well generated but not find the main class even if my jar work with simple
java -jar myfat.jar
If you create a mock project, similar to yours, maybe I could help.
from javapackager.
- a way to specify option by sub tools
I’m not sure what you mean.
the creation on windows need inno setup and WiX. And both have probably their own options. And had a way to specify throught your config part their options.
Also you if you can (money skills time) build or use a CI stack to auto build your project and the projects use your project.
Your example page is really good it permit a fast learning curve (not sure of the sentence) maybe a back link at the end to option list.
If you have the time to add the option to not bundle it can be great.
from javapackager.
- a way to specify option by sub tools
I’m not sure what you mean.
the creation on windows need inno setup and WiX. And both have probably their own options. And had a way to specify throught your config part their options.
Ok, I get you ... but Inno Setup and WIX are too complex to contemplate all their variants. For this reason, I enabled the possibility of adding custom options to the plugin through the extra
property and creating custom templates. However, when there is a common and useful option, I try to add it to the plugin ... as wrapJar
property, for example.
Also you if you can (money skills time) build or use a CI stack to auto build your project and the projects use your project.
Yes, it's a good idea! When I have a little more time, I'd like to add test cases to the plugin.
Your example page is really good it permit a fast learning curve (not sure of the sentence) maybe a back link at the end to option list.
If you have the time to add the option to not bundle it can be great.
Yes, I'll do it.
from javapackager.
wrapJar
property added to winConfig
in 1.2.0-SNAPSHOT, which requires a manual installation.
from javapackager.
I've just released v1.2.0 to Maven Central with the new winConfig.wrapJar
property.
Have you been able to test it?
from javapackager.
I'm going to close this issue ... if it's not resolved, we can reopen it and further investigate the cause.
Thx!
from javapackager.
Hi,
I am taking over the project instead of HumanG33k.
When i try, i have an exception : Module java.activation not found, required by java.xml.soap
from javapackager.
Hi @Trylam!
I've opened a new issue.
Regards
from javapackager.
Related Issues (20)
- After turning on administrator Required, there is no response after entering the password when starting under mac. HOT 14
- With "org.apache.poi" in my project, there is always "module not found" error occured HOT 17
- How to exclude certain jars from copyDependencies task (duplicate handling strategy) HOT 9
- mis/exe installation package custom installation path HOT 3
- Fat Jar doesn't seem to work as expected HOT 13
- How to make a clean terminal app for MacOS? HOT 5
- How can I set the singleInstance property of launch4j through a plugin HOT 3
- About GraalVM HOT 2
- when I try tro execute the .exe file, it repots "The application requires a java Runtime Environment" HOT 21
- How can I package for macOS with the demo ? https://github.com/fvarrui/JavaPackager/issues/409 HOT 1
- Erro “require java runtime environment......” in 1.7.6-SNAPSHOT HOT 2
- Question (or bug) about PKCS11 keystore type HOT 13
- How to keep old data files when upgrading? HOT 10
- Resource loading exception HOT 5
- javapackager packaging and security HOT 1
- Plugin searches for some library `tool.jar` on Mac under hard coded, non-existing path and fails right away HOT 12
- I need help about that HOT 1
- Path resolution causes bundled jre to not be found on linux when building from windows HOT 15
- Incomplete set of modules for customized JRE HOT 4
- Duplicate symbol 'File:default_local.policy' found. This typically means that an Id is duplicated. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javapackager.