我正在处理的项目由几个组件组成——几个独立的库被编译成 JAR,以及一个引用它们的主项目。全部都是用 Scala 编写的。
我在其中一个库中内部使用 ChronicleMap,使用带有自己的编组器的自定义值类。运行主项目时出现以下错误:
/net/openhft/chronicle/core/values/ByteValue$$Native.java:15: error: cannot find symbol
public class ByteValue$$Native implements ByteValue, Copyable<ByteValue>, BytesMarshallable, Byteable {
^
symbol: class ByteValue
/net/openhft/chronicle/core/values/ByteValue$$Native.java:15: error: cannot find symbol
public class ByteValue$$Native implements ByteValue, Copyable<ByteValue>, BytesMarshallable, Byteable {
^
symbol: class ByteValue
/net/openhft/chronicle/core/values/ByteValue$$Native.java:39: error: cannot find symbol
public void copyFrom(ByteValue from) {
^
symbol: class ByteValue
location: class net.openhft.chronicle.core.values.ByteValue$$Native
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:12: error: cannot find symbol
public class ByteValue$$Heap implements ByteValue, Copyable<ByteValue>, BytesMarshallable {
^
symbol: class ByteValue
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:12: error: cannot find symbol
public class ByteValue$$Heap implements ByteValue, Copyable<ByteValue>, BytesMarshallable {
^
symbol: class ByteValue
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:34: error: cannot find symbol
public void copyFrom(ByteValue from) {
^
symbol: class ByteValue
location: class net.openhft.chronicle.core.values.ByteValue$$Heap
/net/openhft/chronicle/core/values/ByteValue$$Native.java:20: error: method does not override or implement a method from a supertype
@Override
^
/net/openhft/chronicle/core/values/ByteValue$$Native.java:25: error: method does not override or implement a method from a supertype
@Override
^
/net/openhft/chronicle/core/values/ByteValue$$Native.java:30: error: method does not override or implement a method from a supertype
@Override
^
/net/openhft/chronicle/core/values/ByteValue$$Native.java:65: error: cannot find symbol
if (!(obj instanceof ByteValue)) return false;
^
symbol: class ByteValue
location: class net.openhft.chronicle.core.values.ByteValue$$Native
/net/openhft/chronicle/core/values/ByteValue$$Native.java:66: error: cannot find symbol
ByteValue other = (ByteValue) obj;
^
symbol: class ByteValue
location: class net.openhft.chronicle.core.values.ByteValue$$Native
/net/openhft/chronicle/core/values/ByteValue$$Native.java:66: error: cannot find symbol
ByteValue other = (ByteValue) obj;
^
symbol: class ByteValue
location: class net.openhft.chronicle.core.values.ByteValue$$Native
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:15: error: method does not override or implement a method from a supertype
@Override
^
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:21: error: method does not override or implement a method from a supertype
@Override
^
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:26: error: method does not override or implement a method from a supertype
@Override
^
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:57: error: cannot find symbol
if (!(obj instanceof ByteValue)) return false;
^
symbol: class ByteValue
location: class net.openhft.chronicle.core.values.ByteValue$$Heap
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:58: error: cannot find symbol
ByteValue other = (ByteValue) obj;
^
symbol: class ByteValue
location: class net.openhft.chronicle.core.values.ByteValue$$Heap
/net/openhft/chronicle/core/values/ByteValue$$Heap.java:58: error: cannot find symbol
ByteValue other = (ByteValue) obj;
^
symbol: class ByteValue
location: class net.openhft.chronicle.core.values.ByteValue$$Heap
这只发生在从 Intellij IDEA 运行项目时,而不是从命令行运行时。
此外,如果我设置了一个独立项目,该项目使用具有相同自定义类和编组器的相同 ChronicleMap,我从 IDE 运行它没有任何问题。仅在从 IDE 运行使用我的库的项目时才会出现此问题。
所以我认为这可能与类加载顺序有关,也可能与 IDE 中缺少的某些依赖项有关,也可能无关。
我可以做些什么来找出为什么我不能从 IDE 运行?