简体   繁体   中英

How to run old school Java programs with latest Java LTS 11?

I want to run Siemens LOGO Soft Comfort.

dell@dell-Precision-M6400:~/Hämtningar/Logo 6.1/Linux/tools/Application$ ./LOGOComfort 
Unrecognized option: -Xincgc
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
dell@dell-Precision-M6400:~/Hämtningar/Logo 6.1/Linux/tools/Application$ 

This is Siemens LOGO soft comfort 6.1 and I have a license for that. But I have an issue.

Unrecognized option: -Xincgc

So how can I do so latest Java LTS 11 can work with Java from 2008? I assume that is Java SE 6 or J2SE 5.0.

With LOGO software, it comes with two folders bin and lib

在此处输入图像描述

在此处输入图像描述

Update:

I removed the -Xincgc in LOGOComfort.lax file and now I got this

dell@dell-Precision-M6400:~/Hämtningar/Logo 6.1/Linux/tools/Application$ ./LOGOComfort 
Invocation of this Java Application has caused an InvocationTargetException. This application will now exit. (LAX)

Stack Trace:
java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
    at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    at DE.siemens.ad.logo.app.Application.<clinit>(Application.java:141)
    at Start.startApplication(Start.java:570)
    at Start.main(Start.java:553)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.zerog.lax.LAX.launch(DashoA8113)
    at com.zerog.lax.LAX.main(DashoA8113)
Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 18 more
This Application has Unexpectedly Quit: Invocation of this Java Application has caused an InvocationTargetException. This application will now exit. (LAX)
dell@dell-Precision-M6400:~/Hämtningar/Logo 6.1/Linux/tools/Application$ 

Update:

Solution:

  1. Remove -Xincgc
  2. Use Java 8 instead. It requries Swing. Java 11 does not use Swing

open the file 'LOGOComfort', as it is likely a shell script. Find the -Xincgc option and remove it.

If it's gobbledygook, install a java6, which does have the now removed -Xincgc option.

If that's not an option, make a fake java: Make a script that rests at the 'real' java location, and all it does is scan for all command line args, strip -Xincgc from it, and pass the rest through unmolested to the real java. This is a crazy hack and is likely to break other things, but it will probably 'fix' this. I strongly recommend you go with one of the first 2 options first.

There is no way to tell java 11+: Can you 'support' the -Xincgc option.

The error message is saying that it can't find the look and feel profile associated with Windows.

java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel

Clearly, this app was intended for Windows in the past. Maybe the script changes the look and feel profile, but I couldn't tell you without looking at it.

Best bet is try this on a Windows machine and see if it goes any further. If not then you'll have to try it with an older JRE that supports that, such as JRE 6.

I know this is a old question, but I still have a solution that may work (it worked for me). You need to make the application java executable by

chmod a+x $PATH_TO_LOGO/Application_64/jre/bin/java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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