Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

java to c#

Thread view: 
kiran1785 - 17 Apr 2006 18:10 GMT
how do i convert my java code to C#.net?
David N. Welton - 17 Apr 2006 18:32 GMT
> how do i convert my java code to C#.net?

With emacs.

Signature

David N. Welton
- http://www.dedasys.com/davidw/

Linux, Open Source Consulting
- http://www.dedasys.com/

Oliver Wong - 17 Apr 2006 18:42 GMT
> how do i convert my java code to C#.net?

   With great difficulty.

   My company specializes in porting and migration, so you could try
contacting them to try and get a price quote: http://www.castortech.com/

   I was actually working on a Java-to-C# project for a while, and while
it's not as bas as, for example, COBOL-to-Java, it's still pretty
non-trivial.

   Note that if all you want is to run Java code on the .NET platform, and
the "C#" part is not actually a requirement, take a look at Mono.NET. You
can use it to compile Java source code to MSIL binaries.

   - Oliver
Homer - 17 Apr 2006 19:41 GMT
I don't think there is such a thing. In term of programming syntax they
are pretty similar (I found out after wasting $70 for C# book). Just
open Visual Studio and start coding and you will see there is nothing
to learn if you know Java.

But in term of everything else (AWT/SWing/WindowsAPI and Other class
libraries) are totaly too different animals.
Roedy Green - 17 Apr 2006 19:46 GMT
On Mon, 17 Apr 2006 13:10:27 -0400, "kiran1785"
<kiran.kiranp@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>how do i convert my java code to C#.net?
That is a bit like saying "How do i take up a life of prostitution?.
You more likely to get an answer from the prostitutes that those
wanting you to avoid such a terrible life destroying error." :-)

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

James McGill - 17 Apr 2006 20:00 GMT
> how do i convert my java code to C#.net?

It depends on whether you do anything with graphics, networking, xml
processing, database connectivity, and what kind of external libraries
you depend on.  Degenerate cases are extremely easy to convert from java
to c#, as the language and even much of the core library are similar
(not an accident).  

Do you want to convert Hello World, or do you want to convert an
enterprise system built on Struts and with lots of complicated
Swing-based GUIs?
Bjorn Abelli - 17 Apr 2006 23:46 GMT
"kiran1785" wrote...

> how do i convert my java code to C#.net?

That depends.

There are some tools for it, e.g. the plug-in to Visual Studio:

http://msdn.microsoft.com/vstudio/downloads/tools/jlca/

The previous version was really lousy IMHO, as it couldn't resolve some
basic classes, when I tried. Even those it could convert was confined to
being either old J++ or Java 1.1.

I haven't tried the latest plugin, which says it can handle conversions up
to 1.3, and even J2EE 1.3.

But I wouldn't rely on tools alone, as there are some differences where it
probably would be better to find a solution better suited wit the new
language.

IMHO, one of the best ways to convert from one language to another, is to do
it "manually", looking for new possibilities in the new language.

// Bjorn A
Adam Warner - 19 Apr 2006 01:48 GMT
> how do i convert my java code to C#.net?

Perhaps you don't need to:
<http://www.ikvm.net/>
<http://www.ikvm.net/uses.html>
richardsosborn@gmail.com - 27 Apr 2006 14:42 GMT
System.out.toCSharp(String existingCodeBase);
Tris Orendorff - 28 Apr 2006 20:12 GMT
> System.out.toCSharp(String existingCodeBase);

Good one!  I'll wager that the OP tries it.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.