ClassNotFoundException 包名称,Java

ClassNotFoundException Package Name, Java

我正在尝试使用套接字和 ObjectOutputStreams 将对象从我的 android phone 发送到我的电脑。 我有一个要发送的对象 "Network"。 这两个 类 在 bot android 和 pc 上是相同的,除了包的东西。在我的电脑上,我没有包名(我不需要?)而在 Android 上我有一个包名(我不能删除它而不会出错)。 所以我想我收到错误是因为 pc 上的程序找不到 class/object 因为包名称无效。 那么,我该如何解决呢? 谢谢

The two classes are identical on bot android and pc, except for the package thing.

所以它们并不相同。

On my pc, I dont have a package name (I don't need to?)

两端需要相同的包名。

and on the Android I have a package name (Which I can't delete without errors). So I guess I get the error because the program on the pc cant find the class/object because the package name is invalid.

正确。

So, how do I solve this?

两端使用相同的包名class