473,395 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1977
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
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.