Support for Java 8

28 views
Skip to first unread message

Igor Gatis

unread,
Dec 1, 2022, 10:35:22 AM12/1/22
to s2geometry-io
Hey folks,

I'd like to use S2 lib for java under Spark environment. In particular, under Databricks 10.4 LTS which uses Java 8.

I download the sources, modified pom.xml to use java 8 sources and the I started to hit weird compilation errors.

For example, it complains about: 
s2-geometry-library-java/library/src/com/google/common/geometry/S2DensityTree.java:783:4
java: cannot find symbol
  symbol:   class JsType
  location: class com.google.common.geometry.S2DensityTree

The project compiles without errors if I comment that like, despite the fact there are 15 other mentions to this annotation in the same file.

My question is: how can I use latest version of S2 lib for java under Java 8 environment?

Igor Gatis

unread,
Dec 1, 2022, 1:05:12 PM12/1/22
to s2geometry-io
I ended up forking the project and fixed the compilation issues.

Torrey Hoffman

unread,
Dec 1, 2022, 1:47:58 PM12/1/22
to s2geometry-io
Hi, 

The JsType annotations are for Javascript interoperability. 
Those should work under Java 8 if you have the jsinterop dependency, but it is safe to remove them.

Reply all
Reply to author
Forward
0 new messages