2016-03-02 67 views
0

我有jsoup.I的.jar文件,参考this link来清除我的疑惑。 但是给出的解决方案没有工作。即使在给出该命令后,我收到以下错误。有关使用jar文件的.class文件的命令

这里是错误。有人可以帮我解决这个问题。由OP发现

G:\javap>javac -cp .;jsoup.jar Jsou.java 
Jsou.java:9: error: cannot find symbol 
Document doc=Jsoup.connect("www.javatpoint.com").get(); 
^ 
    symbol: class Document 
    location: class Jsou 
Jsou.java:9: error: cannot access Jsoup 
Document doc=Jsoup.connect("www.javatpoint.com").get(); 
      ^
    bad class file: .\Jsoup.class 
    class file contains wrong class: org.jsoup.Jsoup 
    Please remove or make sure it appears in the correct subdirectory of the cla 
sspath. 
2 errors 
+0

Document和Jsoup的.class文件必须存在于jar文件中。那么为什么它给出错误“无法找到符号”? – a874

+0

你可以编辑你的问题并添加'Jsou.java'源代码吗? –

+0

@Jonny Henly,感谢您的帮助,但我明白了。我没有导入“import org.jsoup.Jsoup”,这就是问题出现的原因。现在没关系。 – a874

回答

1

解决方案:

@Jonny Henly,感谢您的帮助,但我得到了它。我没有导入“import org.jsoup.Jsoup”,这就是问题出现的原因。现在没关系。