cannot execute binary file ikvmc.exe

193 views
Skip to first unread message

Sam Reid

unread,
Sep 19, 2012, 1:01:11 AM9/19/12
to ooo-...@googlegroups.com

Hi there,


I am trying out ikvm-monotouch for the first time.  I followed all of the building steps before the JNI section in the directions: https://github.com/samskivert/ikvm-monotouch


The five nant phases reported that they completed successfully, and the following files were created in bin/

ICSharpCode.SharpZipLib.dll

IKVM.Reflection.dll

ikvmc.exe

ikvmstub.exe


However, when I cd bin and run ./ikvmc.exe myjar.jar it says "./ikvmc.exe: cannot execute binary file".  I don't think it's a problem with my JAR because I tested that ikvmc.exe myjar.jar works properly on Win7 using the standard ikvmc.  I tried "chmod +x" in case it was an executable problem, but that didn't solve the problem.


I am on OSX 10.7.4.  I thought it might be a 32-bit vs 64-bit problem.  The command "uname -a" tells me I am running 32-bit.  When I booted holding down the "6" and "4" keys it still came up in 32-bit mode though according to uname.  Are the binaries 64-bit binaries, and if so, is there a way to compile for 32-bit (if you think this is the problem?)


Any ideas or suggestions would be appreciated!  Thanks for your time,

Sam

Michael Bayne

unread,
Sep 19, 2012, 3:18:28 PM9/19/12
to ooo-...@googlegroups.com
On Tue, Sep 18, 2012 at 10:01 PM, Sam Reid <samr...@gmail.com> wrote:
> However, when I cd bin and run ./ikvmc.exe myjar.jar it says "./ikvmc.exe:
> cannot execute binary file". I don't think it's a problem with my JAR
> because I tested that ikvmc.exe myjar.jar works properly on Win7 using the
> standard ikvmc. I tried "chmod +x" in case it was an executable problem,
> but that didn't solve the problem.

You can't run C# executables directly on Mac OS. You have to run them
using Mono:

mono ikvmc.exe ...

-- m...@samskivert.com

Sam Reid

unread,
Sep 19, 2012, 9:55:53 PM9/19/12
to ooo-...@googlegroups.com
Thanks Michael!  That fixed the problem and now the executables run without saying "cannot execute binary file".  I'm having another problem (noted below) but thankful for your help getting this far.  You rock!

I was surprised and excited to see that some of my Java GUI applications "just worked" under ikvm on Windows 7, and hoping to do a feasibility test to see what is possible with ikvm-monotouch.  I saw your comments that some "enterprise-y" features are missing, but I wasn't sure if a Java GUI application that works on ikvm-Windows7 would have a fair  chance of working on ikvm-monotouch.  Can you comment on this?

When I try running "mono ikvmc.exe myjar.jar" from the bin directory, I get this error:

bash$ mono ikvmc.exe myjar.jar 

Note IKVMC0004: using main class "edu.colorado.phet.javaversionchecker.JavaVersionChecker" based on jar manifest

Note IKVMC0002: output file is "myjar.exe"

Error: unable to find assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'

    (a dependency of 'IKVM.OpenJDK.Core, Version=0.46.0.1, Culture=neutral, PublicKeyToken=null')


Googling around suggested pointing to the System.Core.dll file directly with a "-r:" flag, but that had the same result.  I also get this error when running from the prebuilt binaries someone posted on dropbox on the PlayN group.  Any thoughts?  I'm not sure what to try next.


Thanks again,
Sam

Michael Bayne

unread,
Sep 20, 2012, 12:20:39 PM9/20/12
to ooo-...@googlegroups.com
On Wed, Sep 19, 2012 at 6:55 PM, Sam Reid <samr...@gmail.com> wrote:
> but I wasn't sure if a Java GUI application that works on ikvm-Windows7
> would have a fair chance of working on ikvm-monotouch. Can you comment on
> this?

It won't work. Nothing outside of java.lang, java.util and some
java.io is likely to work.

-- m...@samskivert.com
Reply all
Reply to author
Forward
0 new messages