简体   繁体   English

在Windows中序列化后在ubuntu中加载.ser文件

[英]Loading .ser files in ubuntu after they were serialized in windows

I wrote a GUI code (Java Eclipse) and compressed it to JAR. 我编写了一个GUI代码(Java Eclipse)并将其压缩为JAR。 The code loads data from .ser serialized file. 该代码从.ser序列化文件加载数据。 It loads fine when using windows but cannot recognize the .ser file when using ubuntu. 使用Windows时,它加载正常,但使用ubuntu时,无法识别.ser文件。 Now , after saving a new .ser in ubuntu , it works just fine but I need the old .ser file to work. 现在,在ubuntu中保存新的.ser之后,它可以正常工作,但是我需要旧的.ser文件才能工作。 any idea how can I do that? 知道我该怎么做吗? Thank you! 谢谢!

Use a portable serialization format. 使用可移植的序列化格式。 In the Windows application, load the old ser file and save it in a format like JSON or XML. 在Windows应用程序中,加载旧的ser文件并将其保存为JSON或XML之类的格式。 The Linux application then needs to load the new JSON / XML file instead of the ser. 然后,Linux应用程序需要加载新的JSON / XML文件而不是ser。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM