尝试运行出错,出错原因:/tmp/tmp_1458557049226652 exit 1, Exception in thread "main" java.lang.UnsupportedClassVersionError: autonavi/tinfo/nagiosMonitor/Main : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:634) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not find the main class: autonavi.tinfo.nagiosMonitor.Main. Program will exit.

 

导致此问题的原因是jar包和服务器环境不一致。在执行jar程序时,指定上java路径就好。

/usr/local/java/jdk1.7.0/bin/java -jar /home/admin/aliMinitor/AutolrNagiosMonitor/AutolrNagiosMonitor-0.0.1-SNAPSHOT.jar

posted on 2016-03-22 16:15  xuxu_dragon  阅读(356)  评论(0编辑  收藏  举报