java. lang.ClassLoader. Error in loadclass (unknown source)
For my paper, I try to deal with some things with pictures. One step to complete it is to find the corners in the pictures After some surfing, I found that it can be implemented with Moravec's corner detection algorithm Fortunately, I found that Moravec's algorithm has been implemented by jfeaturelib on this link: https://code.google.com/p/jfeaturelib/source/browse/src/main/java/de/lmu/ifi/dbs/jfeaturelib/pointDetector/Moravec.java?r=8d96a8fa9a43a0ec7e7084b40169be56bddd6f36
(of course, I imported the jar file provided by jfeaturelib in the eclipse build path) so I used the code in the project link and wrote some code to call it This is the code for me to create a frame, open the picture and call the Moravec algorithm on the link:
import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class Compare{ public Compare(){ JFrame frame = new JFrame("Find corners in picture"); frame.setDefaultCloSEOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = (JPanel)frame.getContentPane(); JLabel label = new JLabel(); label.setIcon(new ImageIcon("house.jpg")); panel.add(label); frame.setLocationRelativeTo(null); frame.pack(); frame.setVisible(true); } public static void main (String[] args){ SwingUtilities.invokelater(new Runnable(){ public void run(){ new Compare(); } }); Moravec picture = new Moravec(); } }
The key is that it returns an error on the line
Moravec picture = new Moravec();
The error is as follows:
Exception in thread "main" java.lang.UnsupportedClassVersionError: de/lmu/ifi/dbs/jfeaturelib/pointDetector/PointDetector : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(UnkNown Source) at java.lang.ClassLoader.defineClass(UnkNown Source) at java.security.SecureClassLoader.defineClass(UnkNown Source) at java.net.urlclassloader.defineClass(UnkNown Source) at java.net.urlclassloader.access$000(UnkNown Source) at java.net.urlclassloader$1.run(UnkNown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.urlclassloader.findClass(UnkNown Source) at java.lang.ClassLoader.loadClass(UnkNown Source) at sun.misc.Launcher$AppClassLoader.loadClass(UnkNown Source) at java.lang.ClassLoader.loadClass(UnkNown Source) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(UnkNown Source) at java.lang.ClassLoader.defineClass(UnkNown Source) at java.security.SecureClassLoader.defineClass(UnkNown Source) at java.net.urlclassloader.defineClass(UnkNown Source) at java.net.urlclassloader.access$000(UnkNown Source) at java.net.urlclassloader$1.run(UnkNown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.urlclassloader.findClass(UnkNown Source) at java.lang.ClassLoader.loadClass(UnkNown Source) at sun.misc.Launcher$AppClassLoader.loadClass(UnkNown Source) at java.lang.ClassLoader.loadClass(UnkNown Source) at Compare.main(Compare.java:32)
Can you give me some advice? Thank you.
Solution
Unsupported major Minor version 51.0
Execute Java - version and see if this is the case If so, find JDK 7 on your system and use it to run your program