0

I am building this project https://github.com/oracle/visualvm . I have JDK10 in my system. I changed the source and target option in build xml to 1.8 from 1.5, as there were error saying 1.5 is not supported anymore. Now, I am getting a compile error pointing to common.xml which is in some other sub-folder.

I have no idea, what is wrong as the error log is also very vague. Also, I am working with Ant for the first time.

Here is the log.

C:\dev\jvisualvm\visualvm\visualvm\netbeans\harness\suite.xml:163: The following error occurred while executing this line:
C:\dev\jvisualvm\visualvm\visualvm\netbeans\harness\common.xml:200: Compile failed; see the compiler error output for details.
        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1425)
        at org.netbeans.nbbuild.CustomJavac.compile(CustomJavac.java:102)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:1133)
        at org.netbeans.nbbuild.CustomJavac.execute(CustomJavac.java:83)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
        at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:306)
        at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:225)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:834)
        at org.apache.tools.ant.Main.startAnt(Main.java:223)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

The part of common.xml where the error is thrown looks like this. (nb-javac srcdir tag)

<target name="compile" depends="init,up-to-date" unless="is.jar.uptodate">
        <mkdir dir="${build.classes.dir}"/>
        <depend srcdir="${src.dir}" destdir="${build.classes.dir}" cache="${build.dir}/depcache">
            <classpath refid="cp"/>
        </depend>
        <property name="javac.fork" value="false"/>
        <nb-javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${build.compiler.debug}" debuglevel="${build.compiler.debuglevel}" encoding="UTF-8"
                  deprecation="${build.compiler.deprecation}" optimize="${build.compiler.optimize}" source="1.8" target="1.8" includeantruntime="false"
                  fork="false">
            <classpath refid="cp"/>
            <compilerarg line="${javac.compilerargs}"/>
            <processorpath refid="processor.cp"/>
        </nb-javac>
        <copy todir="${build.classes.dir}">
            <fileset dir="${src.dir}" excludes="${jar-excludes}"/>
        </copy>
        <processjsannotation classes="${build.classes.dir}" asm="${asm.jar}">
            <classpath refid="cp"/>
        </processjsannotation>
    </target>

Can anyone point me to some direction to resolve this?

1 Answers1

0

You need to build VisualVM with JDK 8. https://github.com/oracle/visualvm clearly mentions it in Get the tools section.

Tomas Hurka
  • 6,723
  • 29
  • 38