In Linux, how to execute Java jar file with external jar files?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Update
You can add the required library in manifest with
Class-Path:
headerFor example :
See
Either use the
-cp
flag:Or add a
Class-Path:
header to your jar's manifest (see Jigar's answer)Note to others who answered with
java -jar <etc>
: The-jar
flag deactivates the standard-cp
flag andCLASSPATH
environment variable, because it retrieves the classpath from the JAR manifest. Any answer that combines-jar
and either-cp
or$CLASSPATH
will not work.This information is well-hidden, but I finally found a reference:
Source: java - the Java application launcher