Nexus启动失败:The nexus service was launched, but failed to start.

升级了JDK为1.8后,Nexus启动就失败了:

C:\WINDOWS\system32>nexus restart
wrapper  | The nexus service was not running.
wrapper  | Starting the nexus service...
wrapper  | The nexus service was launched, but failed to start.
请按任意键继续. . .



查看%Nexus_HOME%下logs目录下的日志文件,如下:

wrapper  | The nexus service was not running.
wrapper  | Starting the nexus service...
wrapper  | --> Wrapper Started as Service
wrapper  | Launching a JVM...
wrapper  | Unable to execute Java command.  系统找不到指定的文件。 (0x2)
wrapper  |     "C:\Environment\Java\jdk1.7.0_45\bin\java" -Djava.io.tmpdir=./tmp -Djava.net.preferIPv4Stack=true -Dcom.sun.jndi.ldap.connect.pool.protocol="plain ssl" -Xms256m -Xmx768m -Djava.library.path="bin/jsw/lib" -classpath "bin/jsw/lib/wrapper-3.2.3.jar;./lib/javax.servlet-3.0.0.v201112011016.jar;./lib/jetty-client-8.1.11.v20130520.jar;./lib/jetty-continuation-8.1.11.v20130520.jar;./lib/jetty-deploy-8.1.11.v20130520.jar;./lib/jetty-http-8.1.11.v20130520.jar;./lib/jetty-io-8.1.11.v20130520.jar;./lib/jetty-jmx-8.1.11.v20130520.jar;./lib/jetty-rewrite-8.1.11.v20130520.jar;./lib/jetty-security-8.1.11.v20130520.jar;./lib/jetty-server-8.1.11.v20130520.jar;./lib/jetty-servlet-8.1.11.v20130520.jar;./lib/jetty-util-8.1.11.v20130520.jar;./lib/jetty-webapp-8.1.11.v20130520.jar;./lib/jetty-xml-8.1.11.v20130520.jar;./lib/jul-to-slf4j-1.7.6.jar;./lib/logback-access-1.1.2.jar;./lib/logback-classic-1.1.2.jar;./lib/logback-core-1.1.2.jar;./lib/metrics-core-2.2.0.jar;./lib/metrics-jetty-2.2.0.jar;./lib/metrics-logback-2.2.0.jar;./lib/nexus-bootstrap-2.10.0-02.jar;./lib/plexus-interpolation-1.16.jar;./lib/slf4j-api-1.7.6.jar;./conf/" -Dwrapper.key="LYrsjNuSdvEB_nhB" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=6124 -Dwrapper.version="3.2.3" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.sonatype.nexus.bootstrap.jsw.JswLauncher ./conf/jetty.xml ./conf/jetty-requestlog.xml
wrapper  | Critical error: wait for JVM process failed
wrapper  | The nexus service was launched, but failed to start.


初步断定是安装了JDK8后,JAVA_HOME的环境变量没有配置好和Nexus配置文件没有更改的问题:

1.在环境变量中正确配置JAVA_HOME,在环境变量中更改JDK的根目录:

C:\Environment\Java\jdk1.8.0_77

2.在Nexus安装目录下,找到【\~\bin\jsw\conf】文件夹,打开【wrapper.conf】文件

找到这行:

# Set the JVM executable

下面有【wrapper.java.command=....】

将这行更改为【wrapper.java.command=自己的JDK安装目录\bin\java】即可。

以我的JDK安装目录为例子

# Set the JVM executable
# (modify this to absolute path if you need a Java that is not on the OS path)
wrapper.java.command=C:\Environment\Java\jdk1.8.0_77\bin\java




你可能感兴趣的:(nexus,启动失败)