Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

(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: 21775
103
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!