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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to combine java and VB

Status
Not open for further replies.

then00b

Programmer
Dec 28, 2003
2
0
0
GB
hi,
I have a project where I need to take 3 seperate tools and combine then into one easy to use application.

All three are fairly complicated and I have no interest in changing the underlying code which make them work.

One tool is written in JAVA and the other two are written in VB. I wish to use VB for this implementation.

My question is. Is it possible to use java and Vb together in any way? e.g. Can VB call procedures in a JAVA compiled class?

Any help would be welcome as would any alternative course of action.

Thanks

the n00b

P.s. I don't want to re-write the java code into VB.

 
Several ways you can do this:
First is by having an intermediate code. COBRA or some sort of SOAP/XML code. These involve passing objects to each other to communicate between the 2 languages.

2nd is employing .NET, This is built with a CLR (common Language runtime) that is designed so that you can program in various programming languages and then when you compile the code everything runs through the same compiler and therefore can communicate together well
 
I like the .net solution but I don't think java is built into the CLR. any other solutions?
 
I don't know enough about Java to be sure, but if the java complies with the COM specs, you should just be able to
Code:
dim myObj as myJavaClass
set myObj = new myJavaClass

but I suspect that the Java will need "tweaking" to get this to work

Alternatively you could shell to the xisting Java app

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
You maybe right about the .Net with the published version not being able to support java although you maybe able to find java plugins somewhere on the internet.
Originally .Net only shipped with VB, C++, C# and JScript but they were about 17 other planned languages including APL and COBOL.

As for getting them talking you could still use XML to transfer data and or use CORBA that does have the ability to have languages calling methods and passing object between those mutual methods.

Alternatively you could have them both write to the same file on the hard disk, but remembering to close it before the other writes to it... although XML would simplify this communication.
 
Something else... my mate VB programmer and I'm java. We also wrote separate programs in our respective languages and we got the 2 talking by using Sockets. Which is another way. It doesn't matter how you talk via sockets as only strings are transmitted (Don't try to transmit data as type as things will go bad).
It worked well as we wrote a simple chat program although had plans (and still do) to write a 3D OpenGL program for internet usage.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top