aspose file tools*
The moose likes Beginning Java and the fly likes Compilation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compilation error" Watch "Compilation error" New topic
Author

Compilation error

Mani Raju
Ranch Hand

Joined: Oct 09, 2012
Posts: 46
Hi,
i am getting error "org.apache.xpath: cannot be resolved".
Even i added xalan-2.7.1.jar file in required location and it is not corrupted.
I could not find the reason for that.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 877
    
    5
Is it possible that you try to use a package name as a class name?
Mani Raju
Ranch Hand

Joined: Oct 09, 2012
Posts: 46
Ivan Jozsef Balazs wrote:Is it possible that you try to use a package name as a class name?

Thanks, i used as "org.apache.xpath.XPathAPI.selectNodeList() ".
Mani Raju
Ranch Hand

Joined: Oct 09, 2012
Posts: 46
Mani Raju wrote:
Ivan Jozsef Balazs wrote:Is it possible that you try to use a package name as a class name?

Thanks, i used as "org.apache.xpath.XPathAPI.selectNodeList() ".
In this case i am getting error.

Mani Raju
Ranch Hand

Joined: Oct 09, 2012
Posts: 46
Mani Raju wrote:
Mani Raju wrote:
Ivan Jozsef Balazs wrote:Is it possible that you try to use a package name as a class name?

Thanks, i used as "org.apache.xpath.XPathAPI.selectNodeList() ".
In this case i am getting error.


I could not find the reason for "org.apache.xpath : can not be resolved".
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14347
    
  22

Can you show us the exact line of code where the error happens? And the exact error message (copy & paste the output of the compiler)?

Are you sure the types of the arguments that you pass to the method match exactly what the method expects? Are you sure that you have the JAR file that contains the package / class / method in the classpath?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Mani Raju
Ranch Hand

Joined: Oct 09, 2012
Posts: 46
Jesper de Jong wrote:Can you show us the exact line of code where the error happens? And the exact error message (copy & paste the output of the compiler)?

Are you sure the types of the arguments that you pass to the method match exactly what the method expects? Are you sure that you have the JAR file that contains the package / class / method in the classpath?


Thanks, nodeLs = org.apache.xpath.XPathAPI.selectNodeList(document.getFirstChild(),xpath);
In this line i am getting error.
Arguments passed correctly.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Compilation error