HighTechTalks DotNet Forums  

Java to JSharp?

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss Java to JSharp? in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
MSFT Developer
 
Posts: n/a

Default Java to JSharp? - 06-03-2005 , 09:51 PM






We have recently acquired a company that has written lot of business objects
in Java. We prefer running our shop in .NET. Is it possible to convert Java
to JSharp or do we need to re-write everything? OR can we compile the Java
code in any Microsoft compiler? Please discuss the best option.

Also, how is the acceptance of JSharp in the industry? I have not heard many
people using JSharp. What are your thoughts?

tia



Reply With Quote
  #2  
Old   
George Birbilis [MVP J#] [9880]
 
Posts: n/a

Default Re: Java to JSharp? - 06-06-2005 , 01:13 PM






Quote:
We have recently acquired a company that has written lot of business
objects
in Java. We prefer running our shop in .NET. Is it possible to convert
Java
to JSharp or do we need to re-write everything? OR can we compile the Java
code in any Microsoft compiler? Please discuss the best option.

Also, how is the acceptance of JSharp in the industry? I have not heard
many
people using JSharp. What are your thoughts?

if you have only binary code use the importer tool of J# to import it and
convert to J# assemblies (maybe to source code too), else try using JAD to
get the Java sources first then use J# compiler to compile

almost all Java1.1 stuff should compile

some Java2 stuff are available (collections, some JFC/Swing too) if you
install the "supplemental UI library" from MSDN

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <birbilis (AT) kagi (DOT) com>
Microsoft Most Valuable Professional
MVP J# for 2004, 2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime (Delphi & ActiveX: VB, PowerPoint, .NET)
+ Plugs (InterProcess/Internet communication)
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
.................................................. .......................




Reply With Quote
  #3  
Old   
Servertec
 
Posts: n/a

Default Re: Java to JSharp? - 06-07-2005 , 11:29 AM



First of all let me say that I don't think that they're many developers
using J#. Java developers tend to be exclusively
UNIX/Linux/Solaris/HP-UX/AIX developers and sadly usually are anti
Microsoft. Microsoft developers would most likely use C# and not J#.
Personally I like J# and I don't hate any platform.

There is a Plug-in for Microsoft VisualStudio .NET 2002/2003, Microsoft
Java Language Conversion Assistant 2.0,
http://msdn.microsoft.com/vstudio/do...a/default.aspx or
Microsoft Java Language Conversion Assistant 3.0 Beta,
http://msdn.microsoft.com/vstudio/do...a/default.aspx,
that attempts to convert Java/J++ code to C#. Personally I have found it to
be unable to port even simple code and that it generates code that is
littered with notes of where a developer would then have to manually go and
resolve issues that it could not address. I have found that if you have to
port something from Java to C# the best thing to do is to have someone who
knows boths Java and C# do it manually. I have done quite of it myself and I
have found it basically a straight forward task, although a bit tidious.
Personally I would prefer migrating the Java code to J#.

You may want to read my ACGNJ .NET SIG presentation on "Migrating Java
Applications to .NET and Migrating .NET Application to Java"
http://www.acgnjdotnetsig.org/java2dotnet.zip

Also a good read is JavaWorld "Migrating Java applications to .Net, How to
convert existing Java or Visual J++ applications to J# or C#"
http://www.javaworld.com/javaworld/j...migration.html

MSDN "Migrating Java Applets to Microsoft J# Browser Controls"
http://msdn.microsoft.com/library/en...asp?frame=true

and ComputerWorld "Migrating Java applications to .Net "
http://www.computerworld.com/develop...,77399,00.html

You may also want to look at my www.dotnetit.org site where you can find:

jCollections GNU Classpath 0.6.0 Collections Package
jNaming GNU Classpath 0.6.0 Naming Package
ORO.NET Apache Jakarta ORO 2.0.8 Text-Processing Package
Regexp.NET Apache Jakarta Regexp 1.3.0 Regular Expression Package
Xalan.NET Apache Xalan 2.5.2 XSLT Processor
Xerces.NET Apache Xerces 2.6.0 XML Parser

If your code uses Java Servlet API and/or JavaServer Pages (JSP), you may
want to consider using Servertec Internet Server .NET Edition, Servlet and
JSP containers created to run on .NET.
http://www.servertec.com/products/iws.net/iws.net.html And if you need an
efficient object store to store your Java objects in .NET you may want to
consider using Servertec Persistent Object Store .NET Edition, an object
oriented database engine for .NET.
http://www.servertec.com/products/pos.net/pos.net.html

Personally I found it very easy to manually migrate Java 1.1.x code to J#.
The only issues that I ran into where that I had to use Vjsresgen,
http://msdn2.microsoft.com/library/f...us,vs.80).aspx, to convert
LocalString.properties files and I had to make minor changes to the code in
places where the J# API was different than the Java API. See my presentation
for complete details. If you have to migrate code that is Java 1.2.x or
greater then the packages that I ported in www.dotnetit.org may come in
handy, especially the jCollections. If you code uses XML in any way then
Xerces.NET and Xalan.NET will be very useful, if not an outright necessity.
For classes, interfaces, ect that where added after Java 1.1.x I was able to
easily manually port them from GNU Classpath to J# with a bit of work
required for dealing with native methods. I found that I could without too
much of a fuss rewrite the native C JNI code in C# or even J# itself! I
rarely had to leave it in C. I even got away by just writing come J# that
called WIN32 API layer. But for someone who does not know C, JNI, WIN32 I
could see where porting this level of code would become a bit tricky and
time consuming. The good thing that that there is not too much native code.

Good luck and let us know how it goes.





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.