gpt4 book ai didi

java - 导入 org.apache.oro 无法解析

转载 作者:行者123 更新时间:2023-12-02 06:00:02 24 4
gpt4 key购买 nike

我正在尝试使用 FTPClient 读取文件名。我使用过commons-net-3.3.jar和commons-io-2.4.jar。但是在执行时,我遇到以下异常,

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
The import org.apache.oro cannot be resolved
The import org.apache.oro cannot be resolved
The import org.apache.oro cannot be resolved
The import org.apache.oro cannot be resolved
The import org.apache.oro cannot be resolved
The import org.apache.oro cannot be resolved
Pattern cannot be resolved to a type
MatchResult cannot be resolved to a type
PatternMatcher cannot be resolved to a type
_matcher_ cannot be resolved
Perl5Matcher cannot be resolved to a type
pattern cannot be resolved
Perl5Compiler cannot be resolved to a type
MalformedPatternException cannot be resolved to a type
result cannot be resolved or is not a field
_matcher_ cannot be resolved
pattern cannot be resolved or is not a field
result cannot be resolved or is not a field
_matcher_ cannot be resolved
result cannot be resolved or is not a field
result cannot be resolved or is not a field
result cannot be resolved or is not a field
result cannot be resolved or is not a field
result cannot be resolved or is not a field
result cannot be resolved or is not a field
result cannot be resolved or is not a field



at org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl.<init>(RegexFTPFileEntryParserImpl.java:19)
at org.apache.commons.net.ftp.parser.ConfigurableFTPFileEntryParserImpl.<init>(ConfigurableFTPFileEntryParserImpl.java:57)
at org.apache.commons.net.ftp.parser.UnixFTPEntryParser.<init>(UnixFTPEntryParser.java:136)
at org.apache.commons.net.ftp.parser.UnixFTPEntryParser.<init>(UnixFTPEntryParser.java:119)
at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParser(DefaultFTPFileEntryParserFactory.java:169)
at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:94)
at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2359)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2142)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2188)
at com.school.util.GetFileList.main(GetFileList.java:32)

最佳答案

看起来您有一个旧版本的 commons-net,它依赖于您的类路径中的 Jakarta ORO。 Commons-net 过去一直依赖 ORO,直到版本 1.4.1 .
如果您使用 Maven/Gradle/Ivy,请确保您没有将此版本作为传递依赖项或其他库获取。
放弃这个旧版本的 commons-net 应该可以解决这个问题。

关于java - 导入 org.apache.oro 无法解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22756090/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com