Accessing JAR files

T

Tlange

We need to interface from VB.NET to a third party
product. They provide an API that was written in Java
and is distributed as a JAR file.

What are the options for accessing the
objects/methods/etc. in a JAR file from VB.NET?
 
P

Peter Huang

Hi Tlange,

Integrate .NET and J2EE With Web Services
http://www.ftponline.com/wss/2003_02/magazine/features/rbonneau/

You may refer to Simon Guest's book, Microsoft .NET and J2EE
Interoperability Toolkit.
http://www.amazon.com/exec/obidos/tg/detail/-/0735619220/qid=1069912792/sr=8
-1/ref=sr_8_1/104-6176793-4170360?v=glance&n=507846


Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
This response contains a reference to a third-party World Wide Web site.
Microsoft is providing this information as a convenience to you. Microsoft
does not control these sites and has not tested any software or information
found on these sites; therefore, Microsoft cannot make any representations
regarding the quality, safety, or suitability of any software or
information found there. There are inherent dangers in the use of any
software found on the Internet, and Microsoft cautions you to make sure
that you completely understand the risk before retrieving any software from
the Internet.
 
T

TLange

I have not checked out the book yet. Thanks for the
information, but I was looking for something more
specific (how to access stuff in a JAR file from
VB.NET). The vendor simply provides us a JAR file, and
we have no control over how they implement anything.

Discussions on the best ways to integrate the two worlds
are interesting but don't really help much in this case.
 
J

Jay B. Harlow [MVP - Outlook]

TLange,
Does the JAR contain executable code or data?

My understanding is that a JAR file is simply a ZIP file, so using a .NET
compatible ZIP library you should be able to read the contents of the JAR
file. (For example the zip library included with J#).

However! if the JAR contains executable code, then you cannot really use it,
as its Java Byte Code, and you would need to load it in a JVM.

If the JAR contains data, then depending on how that data is formatted you
should be able to use it. If the data is Serialized then you may need a
third party utility to deserialize the data. Which the previously mentioned
book discusses.
Discussions on the best ways to integrate the two worlds
are interesting but don't really help much in this case.
Why wouldn't a book telling you how to integrate Java & .NET not help you
read a JAR (Java Archive)? Depending on what is in the JAR you may need to
write a Java wrapper to interop between your venders JAR & VB.NET.

Hope this helps
Jay
 
H

Herfried K. Wagner [MVP]

* "Jay B. Harlow said:
However! if the JAR contains executable code, then you cannot really use it,
as its Java Byte Code, and you would need to load it in a JVM.

=> Java Byte Code is not useful.

SCNR
 
P

Peter Huang

Hi TLange,

As Jay said, jar is an compress file, you can uncompress it, but if you
want to access the .class java byte code, I suggest you use the third-party
solution.
e.g. JNBRIDGE
http://www.jnbridge.com/
OR
If the JAR is exposed with Web Service, You can call it with .NET:
http://www.ftponline.com/wss/2003_02/magazine/features/rbonneau/

If you have any concern on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
This response contains a reference to a third-party World Wide Web site.
Microsoft is providing this information as a convenience to you. Microsoft
does not control these sites and has not tested any software or information
found on these sites; therefore, Microsoft cannot make any representations
regarding the quality, safety, or suitability of any software or
information found there. There are inherent dangers in the use of any
software found on the Internet, and Microsoft cautions you to make sure
that you completely understand the risk before retrieving any software from
the Internet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top