Re: compile java7 classes on linux

Ovidiu MacSiniuc <[email protected]>
Newsgroups gmane.comp.java.ikvm.devel
Message-ID <[email protected]>
Thanks Jeroen, 


Of course, this is the exact idea: to run java code on linux, using Mono.
The problem is that linux ikmv compiler (IKVM.NET Compiler version 0.46.0.1) cannot handle .class files having class format 51.0 (compiled with JDK 7).

I noticed that the ikvm interpreter fails to load such classes (TestApp2 was compiled with javac 1.7.0_04):
$ ikvm -cp lib/someJava7Lib.jar:. TestApp2

Exception in thread "main" java.lang.UnsupportedClassVersionError: TestApp2 (51.0)
at IKVM.NativeCode.java.lang.ClassLoader.defineClass1(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:139)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:232)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:208)
at java.security.AccessController.doPrivileged(AccessController.java:269)
at java.security.AccessController.doPrivileged(AccessController.java:520)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:280)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:348)
at IKVM.Internal.ClassLoaderWrapper.LoadClassImpl(Unknown Source)
at IKVM.Internal.ClassLoaderWrapper.LoadClassByDottedNameFastImpl(Unknown Source)
at IKVM.Internal.ClassLoaderWrapper.LoadClassByDottedName(Unknown Source)
at IKVM.NativeCode.java.lang.Class.forName0(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java)


Regards,
    Ovidiu



On Tuesday, March 4, 2014 4:28 PM, Jeroen Frijters <[email protected]> wrote:
Hi,

The IKVM binaries are platform independent (apart from JVM.DLL and ikvm-native-win32-*.dll). So you can use the 7.x binaries on Mono on Linux too.

Regards,
Jeroen


> -----Original Message-----
> From: Ovidiu MacSiniuc [mailto:[email protected]]
> Sent: Tuesday, March 4, 2014 15:19
> To: [email protected]
> Subject: [Ikvm-developers] compile java7 classes on linux
> 
> Hello,
> 
> I searched a lot the internet but I could not find a positive answer to
> following question:
> 
> Is there support for ikmvc to compile Java 7 sources on linux?
> 
> I know that under Windows there is no such issue because the latest ikvm
> are build on openjdk-7u6-b24-stripped.zip.
> Unfortunately, I only could find ikvm distributions 7.x for Windows; the
> latest version that is available to Linux distributions is 0.46.0.1, and
> that version is built on openjdk6-b22-stripped.zip. Attempting to
> compile java7 classes will result in Warning IKVMC0108 (class format
> error "51.0") being issued and the class file being including it as
> resource.
> 
> Many thanks,
>    Ovidiu
> 
> ------------------------------------------------------------------------
> ------
> Subversion Kills Productivity. Get off Subversion & Make the Move to
> Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works.
> Faster operations. Version large binaries.  Built-in WAN optimization
> and the freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.cl
> ktrk
> _______________________________________________
> Ikvm-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.