简体   繁体   中英

Spring Boot executable jar “invalid or corrupted jar file”

I create fully executable jar by spring-boot-maven-plugin(v1.3.6) this way:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <executable>true</executable>
    </configuration>
</plugin>

When I start result jar like executable (like "./app.jar", not via "java -jar app.jar"), from target directory - the app is correctly starts and works, but if I copy this jar to another directory - I get error: "Invalid or corrupt jar file /home/user/Spring". (I use Linux Mint OS, if this important)

When I start it by "java -jar" command - it works properly in any directory.

How can i copy spring-boot executable jar correctly?

Solved. The problem was in the "space" symbol in the directory name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM