Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: dmcwhinnie on May 18, 2007, 08:12:07 am

Title: Java Automation Interface compile errors
Post by: dmcwhinnie on May 18, 2007, 08:12:07 am
I'm getting bad version errors when trying to compile th Java Interface.  I'm using Java 1.5 anyone else done this?

C:\jdevstudio10132\jdk\bin\javaw.exe -client -classpath "C:\jdevstudio10132\jdev\mywork\EA DDL\Client\classes;C:\Program Files\Sparx Systems\EA Trial\Java API\eaapi.jar" client.Class1
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$100(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

at client.Class1.main(Class1.java:12)
Process exited with exit code 1.
Title: Re: Java Automation Interface compile errors
Post by: jkorman on May 18, 2007, 12:12:28 pm
There is a file SSJavaCOM.dll that must be visible to the jre you are running. I place mine in JAVA_HOME\bin, works fine.

Make sure that you are using the same version of the dll as the associated JavaCOM_API.jar.

Jim
Title: Re: Java Automation Interface compile errors
Post by: dmcwhinnie on May 21, 2007, 04:55:06 am
I tried placing the .dll in the java bin folder, and that doesn't work.  you mention the JavaCOM_API.jar file.  I don't have this jar file, I only have eeapi.jar.  Where would I find this jar file?

What version of Java should I be using?
Title: Re: Java Automation Interface compile errors
Post by: dmcwhinnie on May 21, 2007, 05:22:22 am
Turns out I needed a newer Java version.  Installed 1.6 and it seems to be working now.