Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle / OpenJDK compatibility for com.sun.net.httpserver

Tags:

java

openjdk

Are the Oracle Java and OpenJDK implementations for com.sun.net.httpserver fully compatibile? Should I expect some problems when I develop on Oracle Java, but ship for OpenJDK (docker)?

Eclipse warns me for using 'restricted' package, which makes me some worries, however, Eclipse's warnings are flawed in many domains (maven the most prominent one from my daily life).

Is there a good reason as for current stand (Java 8) for discouraging using of this package in first line? If there is, is it relevant for Oracle vs. OpenJDK or they are fully compatibile for that package?

like image 505
9ilsdx 9rvj 0lo Avatar asked Dec 04 '17 16:12

9ilsdx 9rvj 0lo


1 Answers

That package is part of an exported, JDK-specific API, per https://docs.oracle.com/javase/9/docs/api/jdk.httpserver-summary.html . Exported means you can use it. JDK-specific means it's in both OpenJDK and Oracle JDK, but doesn't necessarily have to be in every implementation. Please see http://openjdk.java.net/jeps/179 for details.

like image 86
Dalibor Topic Avatar answered Nov 14 '22 22:11

Dalibor Topic