-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
References to internal com.sun.* packages in simpleclient_httpserver #533
Comments
How do you propose keeping this working while still supporting Java 6? |
I don't know. Is support for newer Java releases planned while providing support for Java 6? I'm interested to know if I can use this dependency in the near future with up to date Java versions. |
I hope to support newer versions also, however Java has been going out of its way to make breaking changes. |
Java 6 is not supported since 2013 :O |
Same here. Works in some places but this is pretty broken. |
@brian-brazil The problem is that you're assuming com.sun is part of the JDK running the code, which isn't guaranteed. To fix this, it can be included as a transitive dependency. Mostly:
https://stackoverflow.com/questions/30134507/cannot-use-com-sun-net-httpserver-java-8 You can also switch to the apache http core, which is open-source and won't have different behaviors depending on the distribution of JDK you use (Oracle vs AdoptOpen vs Open) https://hc.apache.org/ |
How does one do this?
3rd party dependencies are purposefully avoided in the library where we don't strictly need them, to avoid potential conflicts with dependencies an application itself may have. |
@brian-brazil this may be a case where you strictly need them. The only dependency on central that I can find for this library is this unofficial one: https://mvnrepository.com/artifact/com.sun.net.httpserver/http/20070405 |
Are you saying that the standard Java 8 JREs come with no builtin HTTP server? That doesn't sound right at all. |
Reference: https://www.oracle.com/java/technologies/faq-sun-packages.html |
Getting the same error when trying to use it on Android. |
The
HTTPServer.java
class (insimpleclient_httpserver
) references internalcom.sun.*
packages, which makes the server unsable for modern Java build setups:Starting the server results in the exception:
Tested with
simpleclient_httpserver v0.8.1
andopenjdk version "12.0.2" 2019-07-16
on a Jigsaw Java project.Similar to issue #478.
The text was updated successfully, but these errors were encountered: