reference .NET assembly in JAVA assembly

D

doomsday123

I was wondering if I could reference a .NET assembly inside of a JAVA
assemble for use. I am using one of the .NET internal assemblies and
dont want figure out how to do the same thing in JAVA so i want to just
call the .NET assembly and use that method in my java code.
 
S

Steven J. Sobol

I was wondering if I could reference a .NET assembly inside of a JAVA
assemble for use. I am using one of the .NET internal assemblies and
dont want figure out how to do the same thing in JAVA so i want to just
call the .NET assembly and use that method in my java code.

JNI is your friend. JNI lets you call any native code, whether Win32
or .NET code on a Windows box (in a DLL) or shared library code on an
*ix system. Google will help you find tutorials, etc. on JNI.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

I was wondering if I could reference a .NET assembly inside of a JAVA
assemble for use. I am using one of the .NET internal assemblies and
dont want figure out how to do the same thing in JAVA so i want to just
call the .NET assembly and use that method in my java code.

The best thing would be to rewrite.

The second best would to run two processes one Java and one .NET
and then use socket between them.

If you need to run both in same process, then look at:
- IKVM (open source) for running Java in .NET CLR
- Grasshopper (commercial) to run .NET code in JVM (JEE container)

Arne
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Steven said:
JNI is your friend. JNI lets you call any native code, whether Win32
or .NET code on a Windows box (in a DLL) or shared library code on an
*ix system. Google will help you find tutorials, etc. on JNI.

On Windows JNI can call code in a Win32 DLL with native code.

It can not call code in a .NET assembly.

Arne
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Arne said:
The best thing would be to rewrite.

The second best would to run two processes one Java and one .NET
and then use socket between them.

If you need to run both in same process, then look at:
- IKVM (open source) for running Java in .NET CLR
- Grasshopper (commercial) to run .NET code in JVM (JEE container)

My reply to sobol made me remember a third option:

Java---(JNI)---Win32 DLL with native code---(COM)---.NET assembly

But if you don't know how to call COM components from C++, then it
is not trivial.

Arne
 
V

Vitaly

See Object-Oriented JNI SDK for .NET v.1.1, v.2.0

http://www.simtel.net/product.php[id]95126[sekid]0[SiteID]simtel.net
http://www.simtel.net/product.php[id]98653[SiteID]simtel.net

This is a map of Regular JNI for C++ to .NET. Supports bi-directional
calls,
Java native method implementation with
System.load(...)/System.loadLibrary(...), etc.

Regards,
Vitaly Shelest


I was wondering if I could reference a .NET assembly inside of a JAVA
assemble for use. I am using one of the .NET internal assemblies and
dont want figure out how to do the same thing in JAVA so i want to just
call the .NET assembly and use that method in my java code.



I'm protected by SpamBrave
http://www.spambrave.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top