4

I'm new to Java, and I am trying to import a project from GitHub into Intellij just to get the hang of it. I get an error message when I try to build the solution, and it is saying that the package "com.sun.org.apache.xpath.internal.operations" does not exist. Does anybody know whats wrong? Would really appreciate answers.

My code goes as follows:

import com.sun.org.apache.xpath.internal.operations.Bool;
Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
Dawg Dawgman
  • 41
  • 1
  • 1
  • 2
  • Have you actually downloaded the library in question? Have you added it to the classpath? – Turing85 Jan 12 '18 at 16:45
  • I have tried googling, but haven't found what library it belongs to. Do you know? – Dawg Dawgman Jan 12 '18 at 16:48
  • It would be helpful if you linked to the GitHub project in question, so that we could see what the build file looks like (gradle, maven, etc) or if there is none and you are trying to manually add dependencies. – Mads Hansen Jan 12 '18 at 17:45
  • https://github.com/c2mon/c2mon – Dawg Dawgman Jan 12 '18 at 18:38
  • It is a Maven build file. Have read some rumors that the library I try to import is outdated, and that Java has dropped it in their latest DK's. Do anybody know if this is true? – Dawg Dawgman Jan 13 '18 at 15:22

2 Answers2

8

I had the same problem and changed the SDK for my project from 10 to 1.8. Solved it. For IntelliJ, go to File --> Project Structure

1

I know this answer is a bit late, but I have just experienced a similar issue and stumbled on this question.

The package you are referring to exists in different locations in different releases of Java. In my opinion, the simplest solution is to try to match the version of Java that was originally used to build the project that you are talking about. I say this as your project may contain other dependencies on that same version of Java, which you are not yet aware of.

In your case, I believe that running the project with Java 1.6 will solve this issue.

maxdh
  • 91
  • 8