Hello I have a simple JAXB example class. But while I try to generate an xsd schema to it I am getting a folowing exception
`Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/jpt/jaxb/core/schemagen/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
The steps I came to this error are: Simply created a JAXB project in eclipse Implemented the class below
`package com.prods;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "product")
public class Product {
@XmlAttribute
protected int id; // необязательный
protected String name; // обов’язковий, не пустий рядок
protected double price; // >= 0
protected String descr; // необязательный
protected String[] categories; // необов’язковий, якщо присутній, то не
protected char[] chars;// обов’язковий, можуть бути різними
}
`
T
hen I try to add the xsd schema I am getting this exception. For a target I use java 1.7 mac os X JAXB v2.1. How can I fix this? If I rty to run the project adding main function to the class it is running normaly. The problem accurs when you try to add an xsd schema buy creating it with eclipse. Version of eclise is 2022-12 for Java enterprise.
I tryed to change the Java version I am running to JDK 19 it didn't help ofcors.