gfe.jar SDLParser from java 1.6 to java 11 - java

Hy,
I've ported an old 1.6 java desktop application to java 11, a lot of problems concerning jaxb no more supported on jre but at the end the application is running. Actually I've a problem with a jar named gfe.jar especially on class
de.vcs.spc.ett.sdl.SDLParser extends org.xml.sax.helpers.DefaultHandler
in the jar aren't available source files. Do somebody know if it is available a more recent version of this jar that actually is compiled with java 1.6 instead i need it for java 11.
the exception is:
"de.vcs.spc.ett.sdl.UnknownTypeException: Unknown type 'IdentifiedBlock'."
coming from:
final FieldDef fieldDef =
SDL_PARSER.createFieldDef("IdentifiedBlock");
The same code with the same libraries is working well on Linux.
On internet I can't find any information about this.
Thanks

Related

Java: Where does the Extensions Class Loader get classes from in Java 13?

All the documentation I've been able to find mentions the 'jre/lib/ext' folder but such does not exist on my JRE 13 installation.
I guess somewhere between Java 8 (where I can see the jars in jre/lib/ext) and Java 13, they moved but I've been unable to pinpoint when and how it was done.
Could someone please elaborate what's going on with new JRE's, in terms of where the extension classes reside currently?
The extension mechanism is gone with Java 9, not only moved [:-| , see the Important Changes and Information for Java 9:
The deprecated Extensions Mechanism has been removed. The runtime will refuse to start if ${java.home}/lib/ext exists or the system property java.ext.dirs is specified on the command line.
And also the Changes to the Installed JDK/JRE Image in JDK 9 Migration Guide:
In previous releases, the extension mechanism made it possible for the runtime environment to find and load extension classes without specifically naming them on the class path. In JDK 9, if you need to use the extension classes, ensure that the JAR files are on the class path.

Jasmin NoSuchMethodError when converting to binary Java class

I am trying to use Jasmin to convert Jasmin assembly code to a Java class file. Using the Hello World example from here.
The following error is returned:
Exception in thread "main" java.lang.NoSuchMethodError: jasmin.parser.parse()V
at jasmin.ClassFile.readJasmin(ClassFile.java:1160)
at jasmin.Main.assemble(Main.java:81)
at jasmin.Main.run(Main.java:200)
at jasmin.Main.main(Main.java:157)
I suspect that it may be a problem with the Java version since Jasmin seems to be old and probably implemented using an older Java version.
So far I have tried to run the example using this command: java -jar jasmin.jar test.j.
I have tried to run it with Java 8, 7, 6 and 4 unsuccessfully.
The version of Jasmin I have used is 2.4.
Furthermore I have also tried to download Jasmin's source code and compile it manually, with the same result.
Does anybody have any pointers or ideas on how to solve this issue?
The issue is that, if you have other versions of cup in Java's classpath, jasmin might run intro troubles and it will throw a NoSuchMethodError.
To fix this, just remove the other CUP versions from Java's classpath.
All credit goes to #MargaretBloom for finding the issue.

Java in MATLAB_R2016b

I'm trying to use Java in current MATLAB Version (R2016b).
I just have this simple Class with no dependencies:
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
I changed my JVM for Matlab to my local one as described here
and with version -java I get following output:
Java 1.8.0_111-b14 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
My Java class was compiled by IntelliJ with Project SDK 1.8.0_111 and the containing folder of my .class files were added with javaaddpath to the MATLAB dynamic class paths.
I have no more ideas what could be wrong.
Using older SDKs is not possible as you can not download Java 6 or 7 anymore. (It seems you need a long term support account from oracle to do this)
Anyone can help me getting this to work?
I finally tried packaging my IntelliJ project into a jar file as described here.
Now adding the path with javaaddpath /my/path/to/project.jar to the dynamic classpath seems to work as I can use my Java classes with their full package identifier like com.example.Main in MATLAB now.
Kinda frustrating that .class files won't work with same project settings in IntelliJ.

java 1.6 enum issue com.ibm.ws.webservices.engine.enum.Style.WRAPPED

I am migrating my application from Java 1.4 to Java 1.6 and RSA 7.0 to RSA 8.0
When I am opening my projects which used to be in RSA 7.0, some of the files which are generated from WSDL, getting the following error:
“Syntax error on token , class expected ;
com.ibm.ws.webservices.engine cannot be resolved to a type”
For the below lines:
com.ibm.ws.webservices.engine.enum.Style.WRAPPED
com.ibm.ws.webservices.engine.enum.Use.LITERAL
When we manually changed the class path like below it compiled in 1.6:
com.ibm.ws.webservices.engine.enumtype.Style.WRAPPED
com.ibm.ws.webservices.engine.enumtype.Use.LITERAL
I have tried many option but couldn't find the proper solution. I have also posted the problem in other forum but looks like no solution so far.
I have found the solution to my question by myself, though it took long time, so here is the solution.
change com.ibm.ws.webservice.engine.enum to com.ibm.ws.webservice.engine.enumtype
add "com.ibm.ws.webservices.thinclient_7.0.0.jar" to your classpath and recompile the code.
You can find the "com.ibm.ws.webservices.thinclient_7.0.0.jar" in your <WAS HOME>/runtimes folder
Changing the package structure seems inevitable since enum is a keyword from Java5 onwards.
I have faced a similar issue when I converted a project from Java 1.4 to 1.5

Java compiled with gcj using javax.comm api. Possible?

I have a java program that I'm required to compile into a Linux native program using gcj-4.3. This program requires serial port access. The javax.comm api provides serial port access but I'm not sure how to get my compiled java program to use it.
The target box has Java installed, but of course my compiled program isn't running in the JRE...so I'm not exactly sure how I can link in the comm.jar file or how that file can find the .properties file it requires.
I wonder if I can just compile the comm.jar allong with my .jar file and link the two object files together. Can my code then reference the classes in comm.jar?
Thanks in advance for your help!
I'm not an GCJ expert but I have some suggestions (I'm not providing the syntax, this will require some exploration that I didn't perform):
first, I think that you'll have to compile comm.jar into a (shared) library,
then, you'll have to link your code against the library,
finally, use the GCJ_PROPERTIES environment variable to pass properties to the program at invocation time.
The following pointers might be helpful to implement this:
GCJ---The GNU Compiler for Java (great resources IMO, covers all the steps mentioned above)
GCJ – Getting Started (more an intro but still nice)
Compile ActiveMQ with GCJ (more use cases but I don't think they apply here)
And of course, the official documentation :)

Categories