当我尝试在自定义端口上启动jenkins时,我发现了错误

时间:2018-03-24 21:19:28

标签: java jenkins

我的系统是Linux mint 18.3。 Java版“1.8.0_161”。当我使用命令“java -jar jenkins.war”启动jenkins时 - 所有都正确。当我在tomcat里面开始jenkins时 - 所有人都走了。但是当我试图通过使用命令“java -jar jenkins.war - httpPort = 9090”启动jenkins时,我收到了错误。你能帮我找理由吗?

  Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at Main._main(Main.java:309)
        at Main.main(Main.java:132)
    Caused by: java.lang.IllegalArgumentException: Unrecognized option: --
        at winstone.cmdline.CmdLineParser.parse(CmdLineParser.java:53)
        at winstone.Launcher.getArgsFromCommandLine(Launcher.java:363)
        at winstone.Launcher.main(Launcher.java:334)
        ... 6 more

1 个答案:

答案 0 :(得分:0)

您错过了--httpPort之间的空格。只需将其更改为:

java -jar jenkins.war --httpPort=9090