简体   繁体   English

在 Manjaro Linux 上运行 Java 程序

[英]Running Java Program on Manjaro Linux

I am experimenting with OPCAT for simple systems egnineering models.我正在用 OPCAT 试验简单的系统工程模型。 I know that there is a newer cloud version, but it does not allow sharing and saving models, so I stick with the old OPCAT.我知道有一个更新的云版本,但它不允许共享和保存模型,所以我坚持使用旧的 OPCAT。

It is a java-application and on a windows machine it runs using它是一个 java 应用程序,在它运行的 Windows 机器上使用

java -Xmx1024m -Dopcat.home="%APPDATA%\Opcat" -Dopcat.source="C:\Program Files (x86)\Opcat\Opcat.Structure" -jar "C:\Program Files (x86)\Opcat\Opcat2.jar"

following that logic I converted the terminal input to按照这个逻辑,我将终端输入转换为

java -Xmx1024m -Dopcat.home="/home/dh/opcat" -Dopcat.source="/home/dh/opcat/Opcat.Structure" -jar ~/opcat/Opcat2.jar

unfortunately I get errors (selection, actual output much longer):不幸的是我得到错误(选择,实际输出更长的时间):

log4j:ERROR setFile(null,true) call failed. log4j:ERROR setFile(null,true) 调用失败。 java.io.FileNotFoundException: opcat-log.xml Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/BASE64Decoder java.io.FileNotFoundException:线程“main”中的 opcat-log.xml 异常 java.lang.NoClassDefFoundError:sun/misc/BASE64Decoder

I tried java-15-openjdk and java-16-jdk, the result was alwayas the same.我尝试了 java-15-openjdk 和 java-16-jdk,结果总是一样。 Websearching the problem resulted in me setting different CLASSPATHs, with no effect.网络搜索问题导致我设置了不同的 CLASSPATH,但没有任何效果。

There are many texts out there leading down the rabbit hole of java developing, but I simply do not have the capacity to dig into them.有很多文本可以引导 Java 开发的兔子洞,但我根本没有能力深入研究它们。 I really hope I get a simple solution for the problem, since I am process engineer and nowhere close to a software developer (which I regret alot).我真的希望我能得到一个简单的问题解决方案,因为我是过程工程师,离软件开发人员很远(我很后悔)。

I am using manjaro linux, the OPCAT jar-file can be found here: http://esml.iem.technion.ac.il/opcat-installation/ (very last bullet point).我使用的是 manjaro linux,可以在这里找到 OPCAT jar 文件: http ://esml.iem.technion.ac.il/opcat-installation/(最后一个要点)。 I tried the "How to Install OPCAT on MAC"-help file, but was not lucky.我尝试了“如何在 MAC 上安装 OPCAT”-帮助文件,但并不走运。

I don't know what to expect here, maybe you can point out the right direction.我不知道这里会发生什么,也许您可​​以指出正确的方向。 Thanks..谢谢..

You have an old version of OPCAT which was developed with an old version of Java.您有一个旧版本的 OPCAT,它是用旧版本的 Java 开发的。 Oracle removed the class sun.misc.BASE64Decoder with Java 9, so you need Java 8 to run it. Oracle 在 Java 9 中删除了类sun.misc.BASE64Decoder ,因此您需要 Java 8 才能运行它。

I highly recommend using SDKMAN to manage different versions of SDKs on your system.我强烈建议使用SDKMAN来管理系统上不同版本的 SDK。

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

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