OpenHFT / Zero-Allocation-Hashing

Zero-allocation hashing for Java
Apache License 2.0
787 stars 136 forks source link

Can't build with JDK8 in IDEA #49

Closed csm-dev-hub closed 4 years ago

csm-dev-hub commented 4 years ago

After Clone the repository I try to build this project in IDEA with JDK8. I receive a error in file src/main/java-stub/java/lang/Math.java because JDK8 don't have Math.multiplyHigh and try-catch can't handle this.

gzm55 commented 4 years ago

@csm-dev-hub can it be successfully built via command line?

csm-dev-hub commented 4 years ago

I try this in command line : /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/javac src/main/java/net/openhft/hashing/Maths.java

And still error

src/main/java/net/openhft/hashing/Maths.java:9: error: cannot find symbol
          Math.multiplyHigh(0, 0);
              ^
  symbol:   method multiplyHigh(int,int)
  location: class Math
src/main/java/net/openhft/hashing/Maths.java:41: error: cannot find symbol
        final long upper = Math.multiplyHigh(lhs, rhs) + ((lhs >> 63) & rhs) + ((rhs >> 63) & lhs);
                               ^
  symbol:   method multiplyHigh(long,long)
  location: class Math
gzm55 commented 4 years ago

what's the result of mvn -Dgpg.skip=true clean verify

csm-dev-hub commented 4 years ago
what's the result of mvn -Dgpg.skip=true clean verify

the result is build success

And now I know why : there is a src/main/java-stub/java/lang/Math.java in this project , but IDEA only Mark src/main/java as Sources Root.

After also Mark directory src/main/java-stub as Sources Root in IDEA, build with JDK8 in IDEA will success.

Thank you for help me figure out.