How do I solve compile-time dependency for modules that are removed in JDK11?

Solution Verified - Updated -

Issue

  • Error package javax.jws does not exist occurs when compiling an application that uses JAX-WS with JDK11. If we compile with JDK8, there is no error:
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/test/IdeaProjects/testapp/src/main/java/org/example/servlet/HelloService.java:[3,17] package javax.jws does not exist
[ERROR] /home/test/IdeaProjects/testapp/src/main/java/org/example/servlet/HelloService.java:[5,2] cannot find symbol
  symbol: class WebService

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.2 or later (JDK11 supported EAP versions)
  • OpenJDK 11

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content