• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

(Non) executable jar

 
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I'm trying to build a project with maven, I did the useual: clean-install-package.
The build is successfull, but when I double click my executable jar, nothing happens.
The same thing happend to me the verry first time I did a maven build, then I didn't have a manifest that specified my mainclass, now I do...
Its must be something with the buildsetting in my pom
Anyone an idea what I'm doing wrong?
I use the same build in a different program without a prob.

The build of my pom:
 
Sheriff
Posts: 21784
104
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try running the JAR file from the command line: java -jar <jarfile>. If there are any exceptions they will be shown there.

If you're trying to create a runnable Spring Boot JAR file, you should focus more on the Spring Boot plugin. For instance, the following will take the default JAR file, rename it, and create a bigger JAR file with all dependencies bundled inside:

For more info: https://docs.spring.io/spring-boot/docs/current/maven-plugin/repackage-mojo.html
 
Daniel Demesmaecker
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried that before but got an error saying something about a sourcefile missing or something when trying to execute springboot: repackage
 
Daniel Demesmaecker
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried running from commandline, it can't find/load the mainclass...
 
Daniel Demesmaecker
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And the error I got when using the SpringBoot plugin:
 
Daniel Demesmaecker
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind... I downloaded and executed JarFix and that solved my prob
 
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!