Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Package javax.xml.ws does not exist"

I am rusty on Java and completely new to IntelliJ IDEA, an IDE which has been causing a lot of problems for me so far. I am trying to run a program with the line "import javax.xml.ws.Response;". However, I get the error message "package javax.xml.ws does not exist."

I've tried to select the "Add Java EE 6 JARs to module dependencies" automated solution by IntelliJ IDEA, but it doesn't seem to do anything.

(I believe I am running Java 11, if it makes any difference at all. According to the readme by the author of the code, I should be running Java 8, but so far I haven't been able to because I get an unrelated error when trying to change Java versions with IntelliJ.)

What do I do? Thanks in advance.

like image 884
AGéoCoder Avatar asked Dec 02 '19 06:12

AGéoCoder


2 Answers

Your issue is not related to Java version. It will work for both version 8 and 11.

You will need to either download the jaxws-api jar or add it as a Maven dependency accordingly.

You may download the Jar from the below maven repository URL, and then add it to your build path, or update your pom.xml with this dependency: https://mvnrepository.com/artifact/javax.xml.ws/jaxws-api/2.3.1

like image 53
Prithvi Raj Mundur Avatar answered Oct 18 '22 04:10

Prithvi Raj Mundur


This is intermittent issue and can eat up hours. Try to do below steps

  1. Remove all dependencies from classpath.
  2. Close the project and open it again.
  3. Add all required dependencies.
  4. Clean your project.
like image 29
AbhiN Avatar answered Oct 18 '22 03:10

AbhiN