clover:build error

Checked out the clover project from bitbucket and performed, executed ant global.build

Here are the errors I'm getting

 

clover-buildutil.build:
[javac] Compiling 4 source files to /home/ksondere/work/clover/clover-buildutil/target/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
[javac] /home/ksondere/work/clover/clover-buildutil/src/com/atlassian/clover/build/codegen/InstrumentationBindingAPF.java:3: error: package com.sun.mirror.apt does not exist
[javac] import com.sun.mirror.apt.AnnotationProcessorFactory;
[javac] ^
[javac] /home/ksondere/work/clover/clover-buildutil/src/com/atlassian/clover/build/codegen/InstrumentationBindingAPF.java:4: error: package com.sun.mirror.apt does not exist
[javac] import com.sun.mirror.apt.AnnotationProcessor;
[javac] ^
[javac] /home/ksondere/work/clover/clover-buildutil/src/com/atlassian/clover/build/codegen/InstrumentationBindingAPF.java:5: error: package com.sun.mirror.apt does not exist
[javac] import com.sun.mirror.apt.AnnotationProcessorEnvironment;
[javac] ^
[javac] /home/ksondere/work/clover/clover-buildutil/src/com/atlassian/clover/build/codegen/InstrumentationBindingAPF.java:6: error: package com.sun.mirror.apt does not exist
[javac] import com.sun.mirror.apt.Filer;

 

 

 

1 answer

0 vote

Hey, you need to JDK 1.6 in order to compile Clover as per developer guide

Ah thanks man, for reasons of my own incompetence I suppose I could not seem to find the guide, thanks

modified maven and java versions as per the developer guide.  Verified the versions via the command line, ran ant global.build and now get this error

[exec] Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
[exec] at java.lang.ClassLoader.defineClass1(Native Method)
[exec] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
[exec] at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
[exec] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
[exec] at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
[exec] at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
[exec] at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
[exec] at java.security.AccessController.doPrivileged(Native Method)
[exec] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[exec] at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401)
[exec] at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
[exec] at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
[exec] at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:254)
[exec] at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
[exec] at org.codehaus.plexus.classworlds.launcher.Launcher.getMainClass(Launcher.java:144)
[exec] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:266)
[exec] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[exec] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[exec] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

 

Overstack suggests it's a maven version problem

http://stackoverflow.com/questions/31394456/java-6-unsupported-major-minor-version-51-0

 

However I do have the correct version of maven installed.

 

It simply looks like you're using Maven version which is too new for Java 6. Please take a look at Clover's commons.xml file. When it operates with Maven it calls mvn command. Please verify if it's the Maven 3.2.5, if it's not you can try to run ANT with -Dpath.to.mvn=PATH_TO_MVN325 or simply chaning this file and point this variable to proper path. 

Ah thanks, I tried that and now I'm back to this error even though I'm using java 1.6

Compiling 4 source files to /home/ksondere/work/clover/clover-buildutil/target/classes
[javac] /home/ksondere/work/clover/clover-buildutil/src/com/atlassian/clover/build/codegen/InstrumentationBindingAPF.java:3: package com.sun.mirror.apt does not exist
[javac] import com.sun.mirror.apt.AnnotationProcessorFactory;
[javac] ^
[javac] /home/ksondere/work/clover/clover-buildutil/src/com/atlassian/clover/build/codegen/InstrumentationBindingAPF.java:4: package com.sun.mirror.apt does not exist
[javac] import com.sun.mirror.apt.AnnotationProcessor;
[javac] ^
[javac] /home/ksondere/work/clover/clover-buildutil/src/com/atlassian/clover/build/codegen/InstrumentationBindingAPF.java:5: package com.sun.mirror.apt does not exist
[javac] import com.sun.mirror.apt.AnnotationProcessorEnvironment;
[javac] ^
[javac] /home/ksondere/work/clover/clover-buildutil/src/com/atlassian/clover/build/codegen/InstrumentationBindingAPF.java:6: package com.sun.mirror.apt does not exist
[javac] import com.sun.mirror.apt.Filer;
[javac]

This generally means, you're actually not using JDK 1.6. Potentially, java -version reports 1.6 since it's in the PATH, but ANT uses different JAVA due to various reasons like JAVA_HOME poiting to different JDK or simillar. 

 

You can also consider using OpenClover tool based on Atlassian Clover. This is an innitiative we started with a friend to keep building Clover in our spare time. There are binaries ready to use (with exclusion of Maven integration since we encountered some blockers). Note, this innitiative is not backed by Atlassian. 

Thanks Grzegorz! OpenClover is what I was actually hoping for :-)  Works great!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Hipchat

Moving from Hipchat to Stride? Here’s what you’ll love

Heya, Hipchat friends! We’re so happy you’re checking out   Stride. Whether you know it or not, you have been instrumental in making Stride come to life. Every feature, design, and functionality...

75 views 2 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you