cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donal Lafferty <donal.laffe...@citrix.com>
Subject RE: CloudStack Compile Error
Date Mon, 29 Jul 2013 20:15:12 GMT
FYI, this happens when you accidentally install different versions of Java for compile and
runtime.  

E.g.

Compile with javac...

root@mgmtserver:~/github/cshv3/tools/apidoc# which javac
/usr/bin/javac
root@mgmtserver:~/github/cshv3/tools/apidoc# ls -al /usr/bin/javac
lrwxrwxrwx 1 root root 23 Jul 16 19:58 /usr/bin/javac -> /etc/alternatives/javac
root@mgmtserver:~/github/cshv3/tools/apidoc# ls -al /etc/alternatives/javac
lrwxrwxrwx 1 root root 43 Jul 16 19:58 /etc/alternatives/javac -> /usr/lib/jvm/java-7-openjdk-amd64/bin/javac


Run with java...

root@mgmtserver:~/github/cshv3/tools/apidoc# which java
/usr/bin/java
root@mgmtserver:~/github/cshv3/tools/apidoc# ls -al /usr/bin/java
lrwxrwxrwx 1 root root 22 Jul 16 17:15 /usr/bin/java -> /etc/alternatives/java
root@mgmtserver:~/github/cshv3/tools/apidoc# ls -al /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Jul 16 17:15 /etc/alternatives/java -> /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java



Fix?

In my case, I wanted to try out the version 7 JRE.

 sudo apt-get install openjdk-7-jre

This wasn't enough.  I also had to purge the version 6 JRE

 apt-get purge openjdk-6-*

Sources:  

http://stackoverflow.com/questions/11239086/java-lang-unsupportedclassversionerror-unsupported-major-minor-version-51-0
http://openjdk.java.net/install/
http://askubuntu.com/questions/64329/how-to-replace-openjdk-6-with-openjdk-7

> -----Original Message-----
> From: MEHDI ALI SOLTANI [mailto:mehdi_alisoltani@yahoo.com]
> Sent: 10 May 2013 5:01 PM
> To: dev@cloudstack.apache.org
> Subject: CloudStack Compile Error
> 
> Hi
> I used mvn clean install -P developer,systemvm according to
> https://cwiki.apache.org/CLOUDSTACK/how-to-build-on-master-
> branch.html
> but i got this error
> .
> .
> .
> Exception in thread "main" java.lang.UnsupportedClassVersionError:
> XmlToHtmlConverter : 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: XmlToHtmlConverter. Program will exit.
> [INFO] ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Apache CloudStack ................................. SUCCESS [6.625s] [INFO]
> Apache CloudStack Utils ........................... SUCCESS [27.954s] [INFO] Apache
> CloudStack API ............................. SUCCESS [25.212s] [INFO] Apache
> CloudStack Framework ....................... SUCCESS [0.163s] ....
> ....
> ...
> INFO] Apache CloudStack Developer Tools ................. SUCCESS [0.159s]
> [INFO] Apache CloudStack apidocs ......................... FAILURE [16.577s] [INFO]
> Apache CloudStack marvin .......................... SKIPPED [INFO] Apache
> CloudStack cloudmonkey cli ................. SKIPPED [INFO] Apache CloudStack
> DevCloud ........................ SKIPPED [INFO] Apache CloudStack DevCloud-
> KVM .................... SKIPPED [INFO] ---------------------------------------------------
> ---------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 10:53.864s
> [INFO] Finished at: Fri May 10 20:21:00 IRDT 2013 [INFO] Final Memory:
> 47M/329M [INFO] -----------------------------------------------------------------------
> -
> [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-
> plugin:1.2.1:exec (compile) on project cloud-apidoc: Command execution
> failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1] [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExcepti
> on
> [ERROR]
> [ERROR] After correcting the problems, you can resume the build with the
> command [ERROR]   mvn <goals> -rf :cloud-apidoc
> 
> I tested it without developer    mvn clean install -P systemvm
> 
> but, again i got the same error.
> please tell me how I can fix this error.
> 
> Sincerely
> Mehdi Ali Soltani

Mime
View raw message