svix / svix-webhooks

The enterprise-ready webhooks service 🦀
https://www.svix.com
MIT License
2.39k stars 166 forks source link

Java Libs Project requires Java 1.8, but uses packages introduced in Java 11 #1149

Open alecdesjardins opened 10 months ago

alecdesjardins commented 10 months ago

Bug Report

Description

java.net.http was introduced to Java with 11, not 1.8. Therefore, the java libs project will not compile.

I tried this code:

./gradlew build

I expected to see this happen: build successfully

Instead, this happened: Webhook.java:3 error: package java.net.http does not exist import java.net.http.HttpHeaders;

jameshiew commented 1 week ago

I'm able to import and use the library in a Java 8 project to interact with the Svix webhook service API in general, but can't use this Webhook class. This looks to be the only application code which is using Java 11+ features (e.g. java.net.http.HttpHeaders class).

https://github.com/svix/svix-webhooks/blob/58689c8b38d55d085bdfde04b4afbbc5ef5d7e43/java/lib/src/main/java/com/svix/Webhook.java#L43-L56

Could potentially either bump the minimum supported Java version to 11, or update this class and tests to be Java 8 compatible - though unsure of what would be the best way to do that without affecting existing downstream users of the verify() method.