我使用eclipse生成了一个可运行的jar文件。
在Windows上我执行它没有问题,但在Linux上我得到Error: Could not find or load main class application.Main
我正在使用带有导出设置的Apache CLI和JavaFX:Extract required libraries into generated JAR
JAR
│ jfx8.cssext
│ about.html
│
├───META-INF
│ │ MANIFEST.MF
│ │ ECLIPSE_.RSA
│ │ LICENSE.txt
│ │ NOTICE.txt
│ │
│ └───maven
│ └───commons-cli
│ └───commons-cli
│ pom.xml
│ pom.properties
│
├───application
│ DragonCurve.class
│ Expression$1.class
│ Expression$10.class
│ Expression$11.class
│ Expression$12.class
│ Expression$13.class
│ Expression$14.class
│ Expression$15.class
│ Expression$16.class
│ Expression$17.class
│ Expression$18.class
│ Expression$19.class
│ Expression$2.class
│ Expression$20.class
│ Expression$21.class
│ Expression$22.class
│ Expression$23.class
│ Expression$24.class
│ Expression$25.class
│ Expression$26.class
│ Expression$27.class
│ Expression$28.class
│ Expression$29.class
│ Expression$3.class
│ Expression$30.class
│ Expression$31.class
│ Expression$32.class
│ Expression$33.class
│ Expression$34.class
│ Expression$35.class
│ Expression$36.class
│ Expression$37.class
│ Expression$38.class
│ Expression$39.class
│ Expression$4.class
│ Expression$40.class
│ Expression$41.class
│ Expression$42.class
│ Expression$43.class
│ Expression$5.class
│ Expression$6.class
│ Expression$7.class
│ Expression$8.class
│ Expression$9.class
│ Expression$ExpressionException.class
│ Expression$Function$1.class
│ Expression$Function.class
│ Expression$LazyFunction.class
│ Expression$LazyNumber.class
│ Expression$Operator.class
│ Expression$Tokenizer.class
│ Expression.class
│ Main$ColorType.class
│ Main.class
│ application.css
│
└───org
└───apache
└───commons
└───cli
AlreadySelectedException.class
AmbiguousOptionException.class
BasicParser.class
CommandLine.class
CommandLineParser.class
DefaultParser.class
GnuParser.class
HelpFormatter$1.class
HelpFormatter$OptionComparator.class
HelpFormatter.class
MissingArgumentException.class
MissingOptionException.class
Option$1.class
Option$Builder.class
Option.class
OptionBuilder.class
OptionGroup.class
Options.class
OptionValidator.class
ParseException.class
Parser.class
PatternOptionBuilder.class
PosixParser.class
TypeHandler.class
UnrecognizedOptionException.class
Util.class
Manifest-Version: 1.0
Class-Path: .
Main-Class: application.Main
Name: about.html
SHA-256-Digest: 1fuYr0bu6NsJZCAmSom5QtnvnV0Cg8DwLn77Dd1Ql24=
Name: jfx8.cssext
SHA-256-Digest: b2p9PXeoxqnTdYgBFeKp3s7J9PajukOS3sGqyM4s36I=
我尝试使用java -jar myjar.jar
,java -cp myjar.jar application.Main
执行并获得Error: Could not find or load main class