weixiaohuai 2014-07-15
前面两节说了一下Maven仓库。
这里我们使用nexus搭建Maven仓库——私服
1.下载软件:
nexus下载地址 使用Linux环境 下载 tgz包
http://www.sonatype.org/nexus/go
2.将nexus放在Linux下,使用的是root账号
3.解压 tar -zvxf 文件名
4.目录下面生成一个
5.进入下面的bin目录
6.使用
7.提示警告:
warning - not recommended to run as root
解决方法:
A.临时生效
export RUN_AS_USER=root
B.加入系统变量
vi /etc/profile 加入export RUN_AS_USER=root
8.没有提示错误,但是还是启动不了
日志错误信息:
wrapper | --> Wrapper Started as Daemon wrapper | Launching a JVM... jvm 1 | Exception in thread "main" wrapper | JVM exited while loading the application. jvm 1 | java.lang.UnsupportedClassVersionError: org/sonatype/nexus/bootstrap/jsw/JswLauncher : Unsupported major.minor version 51.0 jvm 1 | at java.lang.ClassLoader.defineClass1(Native Method) jvm 1 | at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) jvm 1 | at java.lang.ClassLoader.defineClass(ClassLoader.java:615) jvm 1 | at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) jvm 1 | at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) jvm 1 | at java.net.URLClassLoader.access$000(URLClassLoader.java:58) jvm 1 | at java.net.URLClassLoader$1.run(URLClassLoader.java:197) jvm 1 | at java.security.AccessController.doPrivileged(Native Method) jvm 1 | at java.net.URLClassLoader.findClass(URLClassLoader.java:190) jvm 1 | at java.lang.ClassLoader.loadClass(ClassLoader.java:306) jvm 1 | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) jvm 1 | at java.lang.ClassLoader.loadClass(ClassLoader.java:247) jvm 1 | Could not find the main class: org.sonatype.nexus.bootstrap.jsw.JswLauncher. Program will exit. wrapper | Reloading Wrapper configuration... wrapper | Launching a JVM... wrapper | JVM exited while loading the application. jvm 2 | Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonatype/nexus/bootstrap/jsw/JswLauncher : Unsupported major.minor version 51.0 jvm 2 | at java.lang.ClassLoader.defineClass1(Native Method) jvm 2 | at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) jvm 2 | at java.lang.ClassLoader.defineClass(ClassLoader.java:615) jvm 2 | at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) jvm 2 | at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) jvm 2 | at java.net.URLClassLoader.access$000(URLClassLoader.java:58) jvm 2 | at java.net.URLClassLoader$1.run(URLClassLoader.java:197) jvm 2 | at java.security.AccessController.doPrivileged(Native Method) jvm 2 | at java.net.URLClassLoader.findClass(URLClassLoader.java:190) jvm 2 | at java.lang.ClassLoader.loadClass(ClassLoader.java:306) jvm 2 | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) jvm 2 | at java.lang.ClassLoader.loadClass(ClassLoader.java:247) jvm 2 | Could not find the main class: org.sonatype.nexus.bootstrap.jsw.JswLauncher. Program will exit. wrapper | Reloading Wrapper configuration... wrapper | Launching a JVM... wrapper | JVM exited while loading the application. jvm 3 | Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonatype/nexus/bootstrap/jsw/JswLauncher : Unsupported major.minor version 51.0 jvm 3 | at java.lang.ClassLoader.defineClass1(Native Method) jvm 3 | at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) jvm 3 | at java.lang.ClassLoader.defineClass(ClassLoader.java:615) jvm 3 | at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) jvm 3 | at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) jvm 3 | at java.net.URLClassLoader.access$000(URLClassLoader.java:58) jvm 3 | at java.net.URLClassLoader$1.run(URLClassLoader.java:197) jvm 3 | at java.security.AccessController.doPrivileged(Native Method) jvm 3 | at java.net.URLClassLoader.findClass(URLClassLoader.java:190) jvm 3 | at java.lang.ClassLoader.loadClass(ClassLoader.java:306) jvm 3 | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) jvm 3 | at java.lang.ClassLoader.loadClass(ClassLoader.java:247) jvm 3 | Could not find the main class: org.sonatype.nexus.bootstrap.jsw.JswLauncher. Program will exit. wrapper | Reloading Wrapper configuration... wrapper | Launching a JVM... wrapper | JVM exited while loading the application. jvm 4 | Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonatype/nexus/bootstrap/jsw/JswLauncher : Unsupported major.minor version 51.0 jvm 4 | at java.lang.ClassLoader.defineClass1(Native Method) jvm 4 | at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) jvm 4 | at java.lang.ClassLoader.defineClass(ClassLoader.java:615) jvm 4 | at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) jvm 4 | at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) jvm 4 | at java.net.URLClassLoader.access$000(URLClassLoader.java:58) jvm 4 | at java.net.URLClassLoader$1.run(URLClassLoader.java:197) jvm 4 | at java.security.AccessController.doPrivileged(Native Method) jvm 4 | at java.net.URLClassLoader.findClass(URLClassLoader.java:190) jvm 4 | at java.lang.ClassLoader.loadClass(ClassLoader.java:306) jvm 4 | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) jvm 4 | at java.lang.ClassLoader.loadClass(ClassLoader.java:247) jvm 4 | Could not find the main class: org.sonatype.nexus.bootstrap.jsw.JswLauncher. Program will exit. wrapper | Reloading Wrapper configuration... wrapper | Launching a JVM... wrapper | JVM exited while loading the application. jvm 5 | Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonatype/nexus/bootstrap/jsw/JswLauncher : Unsupported major.minor version 51.0 jvm 5 | at java.lang.ClassLoader.defineClass1(Native Method) jvm 5 | at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) jvm 5 | at java.lang.ClassLoader.defineClass(ClassLoader.java:615) jvm 5 | at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) jvm 5 | at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) jvm 5 | at java.net.URLClassLoader.access$000(URLClassLoader.java:58) jvm 5 | at java.net.URLClassLoader$1.run(URLClassLoader.java:197) jvm 5 | at java.security.AccessController.doPrivileged(Native Method) jvm 5 | at java.net.URLClassLoader.findClass(URLClassLoader.java:190) jvm 5 | at java.lang.ClassLoader.loadClass(ClassLoader.java:306) jvm 5 | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) jvm 5 | at java.lang.ClassLoader.loadClass(ClassLoader.java:247) jvm 5 | Could not find the main class: org.sonatype.nexus.bootstrap.jsw.JswLauncher. Program will exit. wrapper | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up. wrapper | There may be a configuration problem: please check the logs. wrapper | <-- Wrapper Stopped
问题原因:
JDK版本过低,我使用的JDK1.6但是这个nexus需要7才可以。所以找个低版本的下载
下载历史版本地址:
http://www.sonatype.org/nexus/archived
我下载一个1.9.2
重新下载后,将***.tag拷到Linux中
9.解压
tar -zvxf nexus-oss-webapp-1.9.2-bundle.tar.gz
10.进入nexus-oss-webapp-1.9.2
cd nexus-oss-webapp-1.9.2
11.启动:
12.登陆: