Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

.Net dll from Java

Posted on 2010-09-23
7
Medium Priority
?
959 Views
Last Modified: 2013-12-14
Hi,

I found numerous links about how C++ / Win32 dll s can be called from Java. Some useful links are given below.

http://sourceforge.net/projects/jawinproject/
http://www.experts-exchange.com/Programming/Languages/Java/New_to_Java/Q_23025774.html?sfQueryTermInfo=1+10+30+dll+java

etc. etc.

Now my question is can I use .Net dlls from java?  If it is possible then how it is possible? I repeat, I am not asking about COM dll, but asking about .Net dlls. Which may be heavily dependent on Framework.

Is it possible? I have not any fair idea about CORBA / JNI. Is this possible in those?
0
Comment
Question by:Amitava_Mukherjee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 26

Accepted Solution

by:
ksivananth earned 1000 total points
ID: 33751469
0
 

Author Comment

by:Amitava_Mukherjee
ID: 33752445
Yes, those r nice links which is telling that .Net dlls can be used from Java by JNI. Thanx for that. I really appreciate for those links.

But is there any sample code which demonstrates how to use C# 2008 dll from Java? I am not finding any links, all those are available which are demonstration of how to call C/C++ dlls from java. Please help
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Assisted Solution

by:gordon_vt02
gordon_vt02 earned 1000 total points
ID: 33754489
The same principles should apply to the C# DLL as the C/C++ DLLs.  It is still a native interface.  As long as you are running on a Windows platform and have your java.library.path set correctly you should be ok.
0
 

Author Comment

by:Amitava_Mukherjee
ID: 33759098
is it? there is no diffrence between C/C++ dll and those dlls generated in C# by "Class Library" type project selection? If I add following two lines in that C# dll

using system.windows.forms;

public void SayHello()
{
  MessageBox.Show("Hello", "Test", MessageBoxButton.OK, MessageBoxIcon.Information);
}

compile that in dll, and try to call it from Java, should it work?

Thanx
0
 

Author Comment

by:Amitava_Mukherjee
ID: 33763015
OK, searching in net I have found a usefull (for me atleast) link at the following:

http://www.codeproject.com/KB/java/DebugJavaJNIApplication.aspx

Now as I proceed believing C# dll will work with JNI same as the C++ do, I have stuck out in the following codes of the above link !

#include "NativeAdd.h"

jdouble JNICALL Java_nativegui_NativeAdd_add
  (JNIEnv *env, jclass cls, jdouble n1, jdouble n2)
{
    return n1 + n2;
}

No place to write those lines in C# !! Please help, how this can be done in C#?

Thanx
0
 

Author Closing Comment

by:Amitava_Mukherjee
ID: 33767129
THanx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question