Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

instanciate java class 1

Status
Not open for further replies.

almoes

Programmer
Jan 8, 2003
291
US
Hi,

Is it possible to instanciate a java class from c# code?

thanxs,
alej
 
Having worked in J++ I know that you can create a COM interface to any Java class. In that case, you would be able to reference it in C# as a COM component.

I don't know if there is another tool available that will let you create the COM interface as J++ is a rather arcane tool and you probably can't even buy it anymore.
 
If you want it to run in a seperate process, you can use the System.Threading.Process class to run a copy of java.exe, passing your class as a parameter.

If you want it to run in-process, then you'll need to rewrite it in J#, Microsoft's Java-like implementation.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
hmmm j++ is not really java, but yes then it was possible I used it. I think nevertheless that you can create COM from java code by java plugins. In the case I can create it, it's possible to call a COM object using c#?

thanxs!
alej
 
Yes, you can use directly if you add the vjslib library as Reference in your project (Add Reference->NET tab -> vjslib). Next use like here!
Code:
private void listBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
	java.util.ArrayList ar = new java.util.ArrayList();
	//...
}
obislavu
 
vjslib library
I thought this was no longer supported?

In much the same way as J++ is no longer supported by Microsoft...

Chip H.



____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
doesn't vjs stand for visual j sharp, so the newer version?

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top