snappy-java icon indicating copy to clipboard operation
snappy-java copied to clipboard

JDK21 build problem with gmake: Makefile contains '-source 1.7' and '-target 1.7'

Open blacklion opened this issue 2 years ago • 3 comments

Makefile still contains:

$(TARGET)/jni-classes/org/xerial/snappy/SnappyNative.class: $(SRC)/org/xerial/snappy/SnappyNative.java
	@mkdir -p $(TARGET)/jni-classes
	$(JAVAC) -source 1.7 -target 1.7 -h $(SRC)/org/xerial/snappy/ -d $(TARGET)/jni-classes -sourcepath $(SRC) $<

$(SRC)/org/xerial/snappy/SnappyNative.h: $(TARGET)/jni-classes/org/xerial/snappy/SnappyNative.class

$(TARGET)/jni-classes/org/xerial/snappy/BitShuffleNative.class: $(SRC)/org/xerial/snappy/BitShuffleNative.java
	@mkdir -p $(TARGET)/jni-classes
	$(JAVAC) -source 1.7 -target 1.7 -h $(SRC)/org/xerial/snappy/ -d $(TARGET)/jni-classes -sourcepath $(SRC) $<

It fails with JDK21, as 1.7 is deprecated.

blacklion avatar Oct 25 '23 19:10 blacklion

I've checked, and build with -source 8 -target 8 works, though with warnings about future removal of these options too.

blacklion avatar Oct 25 '23 21:10 blacklion

Good cath. Targeting JDK8 should be no problem. Whenever you have time, I'd appreciate a PR for the fix.

xerial avatar Nov 23 '23 09:11 xerial

With this patch build for me too on OpenJDK 21.0.3+9.1, FreeBSD 14.1 amd64.

VVD avatar Jul 16 '24 17:07 VVD