/*
Win 7 x64 Pro
Java 1.7 x86
Visual Studio 2010 Ultimate
Eclipse
*/Must have Visual Studio. This guide uses Visual Studio 2010.
Must have .NET 4. Mind the framework version. For now use v4.0.30319.
Must have Java 1.5+. JAVA_HOME set correctly.
IDE of your choice. This guide uses Eclipse.
Download the jni4net binaries.bin/proxygen.exe
bin/proxygen.exe.config
lib/jni4net.j-0.8.8.0.jar
(x86) lib/jni4net.n.w32.v40-0.8.8.0.dll or (x64) lib/jni4net.n.w64.v40-0.8.8.0.dll
lib/jni4net.n-0.8.8.0.dllcorflags c:\users\loc\desktop\proxygen.exe /32BIT+ /Forceusage: proxygen.exe path\to\<config>.xml
usage: proxygen.exe path\to\<library>.jar -wd work\directory -cp java\dependenci
es;comma\separated;classpath -dp .NET\dependencies;comma\separated;assemblies
usage: proxygen.exe path\to\<library>.dll -wd work\directory -cp java\dependenci
es;comma\separated;classpath -dp .NET\dependencies;comma\separated;assemblies// Short example
c:\users\loc\desktop\proxygen.exe "c:\users\loc\desktop\testlibrary.dll" -wd "c:\users\loc\desktop"
// Crazy example with dependencies
desktop\proxygen.exe "C:\Users\Loc\Documents\Visual Studio 2010\Projects\hasuite\maplelib2\bin\Release\maplelib.dll" -wd "c:\users\loc\desktop" -cp "C:\Users\Loc\Documents\Visual Studio 2010\Projects\hasuite\maplelib2\bin\Release\naudio.dll"cscC:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exeC:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exepackage com.skipper.test;
import java.io.File;import java.io.IOException;
import testlibrary.Test;import net.sf.jni4net.Bridge;
public class Program {
public static void main(String[] args) { try { Bridge.setVerbose(true); Bridge.init(); Bridge.LoadAndRegisterAssemblyFrom(new File("testlibrary.j4n.dll")); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } Test test = new Test(); test.Hello(); test.Repeat("It works!"); }}loading core from C:/Users/Loc/Documents/_Java/Jni4NetTest/jni4net.n-0.8.8.0.dllloading jni4net.n-0.8.8.0, Version=0.8.8.0, Culture=neutral, PublicKeyToken=134a23405600bab4 from C:\Users\Loc\Documents\_Java\Jni4NetTest\jni4net.n-0.8.8.0.dllloaded jni4net.n-0.8.8.0, Version=0.8.8.0, Culture=neutral, PublicKeyToken=134a23405600bab4 from C:\Users\Loc\Documents\_Java\Jni4NetTest\jni4net.n-0.8.8.0.dllInitialized jni4net corecore loaded from C:/Users/Loc/Documents/_Java/Jni4NetTest/jni4net.n-0.8.8.0.dllclr.version :v4.0.30319clr.arch :32bitjava.home :C:\Program Files (x86)\Java\jre7java.version :1.7.0_65sun.arch.data.model :32loading testlibrary.j4n, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null from C:\Users\Loc\Documents\_Java\Jni4NetTest\testlibrary.j4n.dllloaded testlibrary.j4n, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null from C:\Users\Loc\Documents\_Java\Jni4NetTest\testlibrary.j4n.dllHello World, from C#!It works!--
--
You received this message because you are subscribed to jni...@googlegroups.com
http://groups.google.com/group/jni4net?hl=en-GB?hl=en-GB
http://jni4net.sf.net/
---
You received this message because you are subscribed to the Google Groups "jni4net" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jni4net+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Wiki was kickstarted. Talented github wiki writers and jni4net experts please contribute as well.
--