tobychen1991
V2EX  ›  Java

如何启动一个 jar 包里面的 main 方法

  •  
  •   tobychen1991 · Jul 29, 2019 · 5014 views
    This topic created in 2661 days ago, the information mentioned may be changed or developed.

    不依赖 Springboot,但依赖了其他 jar 包,不能单 class 文件运行。请大神教教萌新

    5 replies  •  2019-07-29 21:46:02 +08:00
    wdmx007
    wdmx007
    Jul 29, 2019
    1
    maven 的话:
    maven-jar-plugin 和 maven-assembly-plugin 了解一下
    arrow8899
    arrow8899
    Jul 29, 2019
    2
    java -cp your_jar_file.jar your.package.name.YourClass
    tobychen1991
    tobychen1991
    OP
    Jul 29, 2019
    3
    @wdmx007 谢谢,可以了
    jay0726
    jay0726
    Jul 29, 2019
    4
    jay0726
    jay0726
    Jul 29, 2019
    5
    @jay0726 #4 csdn 广告太多 可以直接看他的个人博客文章 http://xxgblog.com/2015/08/07/maven-create-executable-jar/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4310 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 01:11 · PVG 09:11 · LAX 17:11 · JFK 20:11
    ♥ Do have faith in what you're doing.