Ошибка: метод Main не найден в классе jsone.testing, определите метод main следующим образом: public static void main (String [] args) или класс приложения JavaFX должен расширять javafx.application.Application
package jsone;
import java.io.File;
import java.io.IOException;
import org.apache.xpath.operations.String;
import org.testng.annotations.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
public class testing {
@Test
public static void main(String args[]) {
ObjectMapper mapper = new ObjectMapper();
try {
File jsonInputFile = new File("D:\\workspace\\jsone\\car.json");
car emp = mapper.readValue(jsonInputFile, car.class);
System.out.println(emp);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
package jsone;
public class car{
private String colour;
public String getcolour() {
return colour;
}
public void setcolour(String colour) {
this.colour = colour;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("\n----- Employee Information-----\n");
sb.append("Colour: " + getcolour() + "\n");
sb.append("*****************************");
return sb.toString();
}
}