Visual J#: What is it?

Sometime back the following question came up on an internal discussion:

"How to call method written in x lanuage from C#. In particular, I have several Java-language classes that I don't want to rewrite them in C#. How can I call them from C#. I understand that I can call a C/C++ dll from C# and load jvm within the c/c++ code. But is there anything more efficient?"

The answer to this question pretty much explains why Visual J# exists. Here is what I replied to the above question:

Apart from the load-jvm-and-execute option, you do have a few sleeker options:

1. If you have compiled .class binaries only and you don’t have access to the Java-language sources, you can use JBImp.exe (part of .NET SDK) to convert the .class files to managed assemblies.

JBImp will convert all compiled code that meets certain conditions.

Once you have managed assemblies – you can pretty much use it from any managed language – J#, C#, VB, MC++, etc.

2. If you have access to the J++ project and associated Java-language sources and you want to continue coding in the same language, you should run your sources through the J++ to J# Upgrade Wizard (part the VS IDE). This upgrade wizard will generate an upgrade report that lists all compatibility issues etc. and gives you suggestions/workarounds on how to modify them so that they can be compiled for the .NET platform.

Once the upgrade wizard is done you will get J# code that can be compiled (with the modifications suggested in the upgrade report) into managed assemblies using the J# complier.

(Note that if you do not have access to only the Java-language sources and not the J++ project, you may not be able to run J# Upgrade Wizard. Nevertheless you can simply compile the sources and as long as these conditions are met)

3. If you are keen on moving into .NET completely, C# should be your choice of language.

In that case you will need to run your sources through the Java Language Conversion Assistant (part of VS IDE).

The JLCA will basically convert your Java-language sources to C# sources and C# compiler will do the rest for you.

(Please see the foot note on JLCA)

Having said that, J# is the solution for Java-language developers on .NET platform.

The Visual J# tool comes with its compiler, a Java binary importer (JBImp above) and complete java-language support subject to this. Visual J# is also integrated into the VS IDE – you create/manage projects (and migrate J++ projects), use a number RAD tools for a super coding experience, use a rich visual debugger, build deployment solutions, etc.

For more information please visit the Visual J# home page. There you can get the latest information, articles, documentation, downloads, etc.

In my next post I will talk about Visual J# 2005 features and which of those I work on.

Please note:

1. JLCA is a very powerful tool and is shipped by a sister team of Visual J#, internally called the NetStep Team. TBright is a Program Manager in that team.

2. Microsoft Visual J# .NET is not a tool for developing applications intended to run on a Java virtual machine. Applications and services built with Visual J# .NET will run only in the .NET Framework; they will not run on any Java virtual machine. Visual J# .NET has been independently developed by Microsoft. It is neither endorsed nor approved by Sun Microsystems, Inc.