NoClassDefFoundError: java.util.Objects Android
android
Solution
I have the same problem in my new game. And i think, it happends, because different mobile manufacturer provide phones with different version of jvm.
My solution of this problem was copying implementation of methos equals from Objects to my project. It dirty, but work:
public static boolean equals(Object a, Object b) {
return (a == b) || (a != null && a.equals(b));
}
Problem
In two projects that I've contributed I've had this Error: ``` FATAL EXCEPTION: main java.lang.NoClassDefFoundError: java.util.Objects ``` That because I've implemented `hashCode` and `equals` methods using `Objects` class. ``` @Override public int hashCode() { int hash = 7; hash = 97 * hash + Objects.hashCode(this.image); hash = 97 * hash + Objects.hashCode(this.car); return hash; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final SummaryContent other = (SummaryContent) obj; if (!Objects.equals(this.image, other.image)) { return false; } return Objects.equals(this.car, other.car); } ``` When I compile I don't get error or warnings. Why might it be happening?