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;
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
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.
Related
I am so frustrated right now. I was trying to follow this tutorial
https://www.callicoder.com/java-read-write-csv-file-opencsv/ to use openCSV in java to read some file. After I set up every thing. I got these error.
And, then I did some research. And I follow the answer https://stackoverflow.com/a/42929382/8371801
Now my pom look like this
Then the problem fixed. Every thing works perfect. So I just want to know what happened. What does pom file exactly do? What does Maven exactly do? I did many researches on line but I am still so confused. Why my java version is 10.1 it still work when I enter 1.8 in pom.
Maven does many things. In your case it downloads the opencsv library for you and invokes javac for you.
The properties you've set in your pom.xml (one of maven's configuration files) control whats passed in javac's -source and -target options.
Essentially thru maven you have defined what version of java to use. You can also do the same kind of thing going to the modules->dependencies in the module settings.
A useful link
Difference between intellij Project make and Maven Compile?
I'm working on a Netbeans project and I'm trying to import these packages but It doesn't exist
Error Displayed
could someone tell me how to fix this problem
Thank you
Whenever you cannot find a package, you should download it from its source and then add it to your project. Here you can take a look at jOOQ/jOOL. As about the other two, make sure you are using Java 8. You will also need to know how to add packages to your projects in the future.
I have the problem same as this.
I just tried to figure out how does hashmap internally works. So I want to debug the source code of SDK.
Currently. I think What I am looking for the compiled version with debug information for Java SE 1.7. i.e. compile using javac -g.
I think I am not the only guy who want to do this. So anyone who knew the link or already done this before. (Sorry for I am the lazy man.Forgive me that. ) Please kindly share the work result for me. Well appreciated. Thanks.
You do need to compile those classes with debugging yourself.
Distributing such a package would probably be a violation of Oracles License Agreement.
The post you linked has detailed instructions on how to do that.
The link in my question actually answered my question. But I just want to add missed part it didn't mention. The endorsed jar file should be joined in the installed JRE as an external jar otherwise it doesn't work. Thanks.
I'm running a simple java project on Android (using Eclipse ADT).
During debugging I see that a value is not set correctly.
I think this screenshot says it all:
Any idea what can cause this?
Thanks a lot,
Omer
After a lot of struggles what solved the problem for me is the following:
Project -> clean , like Simon suggested.
Restart eclipse.
Fix build path (after clean , I got error in my build path not refrencing the JRE).
Fix android target version. (After clean I got some error on the target).
Save files.
Restart eclipse (again).
This was one of the strangest things I've encountered as a programmer,
and I'm not really sure until now what the problem was and which of the above steps helped to fix it.
So , I've decided to write all of the steps, hoping it might do some good to some other pour soul.
Simon- Thanks again.
I'm new at Android world. Just learning. I want to study build this project. But it fails for all R.* members and so other reasons. After searching the web I found several blogs to fix generated R.java files. But I couldn't fix it. Maybe I don't much about Android and Java. Can anybody make a Eclipse project out of this example which is build properly? Thanks in advance!
Try cleaning your project. If that won't work check your xml files for any error. That's the most common reason for getting errors related to R.java*.