Open ruanjiaxing opened 4 years ago
To be clear, the batch files are easily converted into shell scripts. But when I run ./gpcp.sh test.cp it failed with the following error:
Exception in thread "main" java.lang.ClassFormatError: Illegal class name "LCP/CPJrts/XHR;" in class file CP/Visitor/Visitor_ImplementedCheck 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 CP.gpcp.gpcp.main(gpcp.cp:42
When I use javap to disassemble CP/CPJrts/XHR.class it showed the class name to be CP.CPJrts.XHR.
I have limitted knowledge about Java but I think it's a typo that caused this error.
Never mind. The problem faded away when I installed Java 8 and set it as the default Java.
Everything was possible thank to the cross platform awesomeness of Java :)
BTW, I have ported gpcp batch files to shell scripts. Check it here. I'm very new to github so I don't know how to make a pull request. Sorry.
Hi ruanjiaxing
Thank you for your enquiry. I will take a look at your batch file to shell-script port, it sounds awesome.
Regards
John Gough
From: ruanjiaxing [mailto:notifications@github.com] Sent: Tuesday, May 19, 2020 3:32 AM To: k-john-gough/gpcp Cc: Subscribed Subject: Re: [k-john-gough/gpcp] Could you make gpcp jvm work on Linux? (#14)
Never mind. The problem faded away when I installed Java 8 and set it as the default Java.
Everything was possible thank to the cross platform awesomeness of Java :)
BTW, I have ported gpcp batch files to shell scripts. Check it here https://github.com/ruanjiaxing/gpcp-shell . I'm very new to github so I don't know how to make a pull request. Sorry.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/k-john-gough/gpcp/issues/14#issuecomment-630330256 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEC5EFCUA7H3URPQXPAW3ILRSFWIJANCNFSM4NEGO6YA . https://github.com/notifications/beacon/AEC5EFA5ZGLGO6ERLNFTQRLRSFWIJA5CNFSM4NEGO6YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEWJBHEA.gif
The shell scripts allowed me to have a working gpcp compiler on Linux. But from the output of gpcp's utilities I think there are still Windows specific code, e.g: environment variable on the help screen still use Windows format. I think when we started to use something related to it, it will fail. But I'm not yet reach this state. Currently only possible to compile the shipped examples.
Update: so far no problem encountered. I think you could consider adding my shell scripts alongside with the batch files in your release.
I think it's safe to said gpcp jvm works on Linux, too. You only have to update the help screen printed by gpcp's utilities to the Linux environment variable syntax, e.g: instead of %MYVAR% it is $MYVAR. It's only done to prevent the users from using the Windows syntax mistakenly on Linux (assumed he is newly migrated to Linux, long term Linux users will not have this simple mistake). Java is a great abstraction layer, now I believe in the "write once, run everywhere" slogan of it!
@proberon Is it working on Linux now? I want to know about both the .NET and the JVM version.
I know there are limitations on .NET implementations on Linux but the JVM is already worked very well. I found that gpcp doesn't work on Linux, even with the jvm version. Please consider support Linux, it's an awesome system. From my limited knowledge I think we only have to create the equivalent shell scripts of the batch files and everything would work but it turned out to be wrong. I don't understand the internals of gpcp so I can only ask for your help.
Looking forward to your answer, jiaxing.