PX4 / FlightPlot

PX4 flight log plotter for ulog format
60 stars 54 forks source link

Build fails with "java.lang.NoClassDefFoundError" #31

Open H3xept opened 3 years ago

H3xept commented 3 years ago

Hi, I'm trying to build FlightPlot from source but I'm getting a "NoClassDefFoundError". I'm on macOS Big Sur (11.4). I also needed to update the build.xml file; source and target versions (1.6) are now deprecated. I instead used "1.8".

Here's the complete error log:

` BUILD FAILED /Users/h3xept/Desktop/FlightPlot/build.xml:24: java.lang.NoClassDefFoundError: sun/misc/Resource at com.intellij.compiler.instrumentation.InstrumentationClassFinder$ClassFinderClasspath.getLoader(InstrumentationClassFinder.java:499) at com.intellij.compiler.instrumentation.InstrumentationClassFinder$ClassFinderClasspath.getLoader(InstrumentationClassFinder.java:470) at com.intellij.compiler.instrumentation.InstrumentationClassFinder$ClassFinderClasspath.getResource(InstrumentationClassFinder.java:436) at com.intellij.compiler.instrumentation.InstrumentationClassFinder.getClassBytesAsStream(InstrumentationClassFinder.java:148) at com.intellij.compiler.instrumentation.InstrumentationClassFinder.loadClass(InstrumentationClassFinder.java:104) at com.intellij.uiDesigner.compiler.StringPropertyCodeGenerator.generateClassStart(StringPropertyCodeGenerator.java:56) at com.intellij.uiDesigner.compiler.AsmCodeGenerator$FormClassVisitor.visit(AsmCodeGenerator.java:254) at org.jetbrains.asm4.ClassReader.accept(Unknown Source) at org.jetbrains.asm4.ClassReader.accept(Unknown Source) at com.intellij.uiDesigner.compiler.AsmCodeGenerator.patchClass(AsmCodeGenerator.java:184) at com.intellij.uiDesigner.compiler.AsmCodeGenerator.patchClass(AsmCodeGenerator.java:154) at com.intellij.uiDesigner.compiler.AsmCodeGenerator.patchFile(AsmCodeGenerator.java:126) at com.intellij.ant.Javac2.instrumentForms(Javac2.java:298) at com.intellij.ant.Javac2.compile(Javac2.java:215) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:1117) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) 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:1401) at org.apache.tools.ant.Project.executeTarget(Project.java:1374) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1264) at org.apache.tools.ant.Main.runBuild(Main.java:827) 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) Caused by: java.lang.ClassNotFoundException: sun.misc.Resource at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1383) at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1338) at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1093) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) ... 32 more

Total time: 0 seconds `

I'm not familiar with the ant build tool -- how can I fix the problem and build the program? Thanks!

Victozzz commented 3 years ago

Hi,

Did you find a solution to finally build the program ? I'm facing the same issue... Can anyone help please ?

Thanks

minthukyaw99 commented 3 years ago

I am not expert in java but I did the following. brew install --cask adoptopenjdk brew install --cask adoptopenjdk8 switch version to 8 export JAVA_HOME=/usr/libexec/java_home -v 1.8

afwilkin commented 2 years ago

This helped.

for linux sudo apt-get autoremove default-jdk openjdk-11-* sudo apt install openjdk-8-jdk

worked like a charm