473,513 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How ? .net call Java class

hi.everyone..
Suppose, i have a Java class:

public class Test{
public String testMethod(String args){
return "Hi I am Java";
}
}
How could .net call method "testMethod"? Any suggestions,or related links?
Also welcome to discuss via msn : seu_li at hotmail dot com.
thanks any replies in advance.
Jul 21 '05 #1
5 1985
The easiest way is to compile the Java code with J# in order to build a .NET
DLL. Then you can reference the DLL from other .NET projects n any language.

"SmartGuy" <Sm******@discussions.microsoft.com> wrote in message
news:D5**********************************@microsof t.com...
hi.everyone..
Suppose, i have a Java class:

public class Test{
public String testMethod(String args){
return "Hi I am Java";
}
}
How could .net call method "testMethod"? Any suggestions,or related links?
Also welcome to discuss via msn : seu_li at hotmail dot com.
thanks any replies in advance.

Jul 21 '05 #2
Ed Kaim [MSFT] <ed****@online.microsoft.com> wrote:
The easiest way is to compile the Java code with J# in order to build a .NET
DLL. Then you can reference the DLL from other .NET projects n any language.


Well, that's only the easiest way if the Java code only requires Java
1.1, isn't it? (Unless I've misread something, J# doesn't support
Java2, i.e. Java 1.2 and higher.)

Another possibility is a Java<->.NET bridge: see
http://j-integra.intrinsyc.com/

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3
perhaps this article will fill in some of the blanks for you.
http://www.devx.com/interop/Article/19928

--- Nick

"SmartGuy" <Sm******@discussions.microsoft.com> wrote in message
news:D5**********************************@microsof t.com...
hi.everyone..
Suppose, i have a Java class:

public class Test{
public String testMethod(String args){
return "Hi I am Java";
}
}
How could .net call method "testMethod"? Any suggestions,or related links? Also welcome to discuss via msn : seu_li at hotmail dot com.
thanks any replies in advance.

Jul 21 '05 #4
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Ed Kaim [MSFT] <ed****@online.microsoft.com> wrote:
The easiest way is to compile the Java code with J# in order to build a ..NET DLL. Then you can reference the DLL from other .NET projects n any
language.
Well, that's only the easiest way if the Java code only requires Java
1.1, isn't it? (Unless I've misread something, J# doesn't support
Java2, i.e. Java 1.2 and higher.)

Another possibility is a Java<->.NET bridge: see
http://j-integra.intrinsyc.com/


Since we're mentioning bridging products, we should also mention
JNBridgePro. See www.jnbridge.com.

BTW, if you only have binary for your Java code, you pretty much need a
bridge or similar technology to accomplish the interop.

Wayne
____________________________________
Wayne Citrin
JNBridge, LLC
ci****@jnbridge.com
www.jnbridge.com
Spanning the Worlds of Java and .NET
____________________________________
Jul 21 '05 #5
Wayne Citrin <ci****@jnbridge.com> wrote:
Another possibility is a Java<->.NET bridge: see
http://j-integra.intrinsyc.com/


Since we're mentioning bridging products, we should also mention
JNBridgePro. See www.jnbridge.com.

BTW, if you only have binary for your Java code, you pretty much need a
bridge or similar technology to accomplish the interop.


I knew there was another popular one - just couldn't remember the name.
Apologies :(

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4833
by: parthan | last post by:
We are running our c++ program as Windows services which uses JNI. > Program is getting CLASSPATH env variable correctly and also > initializes JVM successfully. After initializing JVM, programs...
5
14387
by: Ayesha Ahsan | last post by:
Hi, I use Runtime.getRuntime().exec(command) to make my system call. For Windows based Dos, i add "cmd /c" before I type in my system call. So for example make the system call "dir": String...
0
2203
by: aychai | last post by:
Hi all, I am trying to make use Oracle9i db to call an external .Net Web Service from a JAva Stored Procedure. I created the .Net Web Service and use JDeveloper 9.0.3.4Build(1247) to create...
6
4693
by: Eugene A | last post by:
Hello. In this call from a Java prog to a Oracle SP I am trying to pass along some varchars and a cursor, but apperently the syntax of the call to the stor proc is incorrect. What am I doing...
4
3229
by: Jean-Marc Blaise | last post by:
Dear all, I have simulated the windows MULTI application with a java program calling the SQLTP1DL proc referenced as DB2DARI application, on Linux Intel or ZLinux. If the proc is NOT FENCED,...
12
2037
by: karen | last post by:
Hi all : this is going to be a long post. So i apologize in advance :) i am converting a java program in VB right now. I am a java programmer by trade. so i am no expert in this department. I...
46
3787
by: Steven T. Hatton | last post by:
I just read §2.11.3 of D&E, and I have to say, I'm quite puzzled by what it says. http://java.sun.com/docs/books/tutorial/essential/concurrency/syncrgb.html <shrug> -- NOUN:1. Money or...
11
18313
by: Rahul | last post by:
Hi Everyone, While working with Java, i came across super() which passes values to base class constructor from derived class constructor. I was wondering if this could be implemented in c++ by...
11
11981
by: BigZero | last post by:
Hello, can i call Java method.That is java code from php,here what i m looking for i have class called DB in this class all the DB related things ,like DB connection DB insert,DB read etc...
6
6656
by: Christopher | last post by:
Its been awhile and I am rusty. Can the constructor of my class call another method in the same class if that other method does not change any member data? I want to simply have a seperate...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.