In my spring-boot application I've used some model classes and further I need to use the same classes in my android application. So I just export the model class to jar file and put into libs folder in android. I've used some mongo-data annotations(@Document, @Field, etc) in my model class, here my code
@Document(collection="time_table")
public class TimeTable implements Serializable {
private static final long serialVersionUID = 1L;
private ObjectId id;
@Field("day")
private String day;
@DBRef
private List<Subjects> subjects;
public TimeTable() {
super();
}
public TimeTable(String day, List<Subjects> subjects) {
super();
this.day = day;
this.setSubjects(subjects);
}
public ObjectId getId() {
return id;
}
public void setId(ObjectId id) {
this.id = id;
}
public String getDay() {
return day;
}
public void setDay(String day) {
this.day = day;
}
public List<Subjects> getSubjects() {
return subjects;
}
public void setSubjects(List<Subjects> subjects) {
this.subjects = subjects;
}
}
Here, I've used Eclipse export feature to convert the model classes into jar file. But in my android whenever I try to access the TimeTable class from the jar file it displays the error
Unable to load JDK7 annotation types; will have to skip
could not load Java7 Path class
I'm using Jackson 2.7.3 to map those object
if I changed the Jackson version to 2.9.3, the error will also be changed
Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added
so Is there any good way to fix this problem, OR is there any way to get rid those annotations while making jar files.
I've also referred this link Jackson unable to load JDK7 types on Android
But I didn't get clear.