SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: Java in .NET

  1. #1
    SitePoint Wizard dominique's Avatar
    Join Date
    Dec 2000
    Location
    orbis terrarum
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Java in .NET

    Does anyone know of recent news concerning Java support in .NET?

    I heard at one point that someone was building a Java compiler for .NET (since MS obviously did not include one). Does anyone know the status of this? Or has it been dropped in favor of MS's J#?

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What would you consider to be the difference betwen a Java compiler for .NET and Microsoft's J# .NET? From what I understand of your question, J# is exactly what you're asking for.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  3. #3
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Courtesy of our very own kevin yank:

    MICROSOFT .NET, JAVA AND YOU

    As if the waters surrounding Microsoft's upcoming .NET platform weren't muddy enough, Microsoft's launch of Visual J# .NET (also known under the unofficial codename Java.NET) Beta 1 is set to add to the confusion. When you look beyond the marketing hype, however, the motivation behind this new Java syntax support is just as confusing.

    First of all, if you're anything less than an ardent supporter of Microsoft development tools, you could be forgiven for asking a common question: 'What is .NET?' In short, .NET is Microsoft's new platform for Windows and Web application development. .NET is a big collection of Microsoft server software and development tools that have all been designed to work together. The idea is to make things easier for today's developers who face increasing demands to produce products that go beyond the bounds of traditional software development.

    At the heart of .NET is the Common Language Runtime (CLR). All .NET programs (be they Windows applications or Web pages written in ASP.NET) are compiled ahead of time into Microsoft Intermediate Language (MSIL) files. From the point of view of a Windows user, these files look and behave just like Windows .EXE and .DLL files; however, instead of being written in machine code suitable for native execution in Windows, .NET programs use a set of instructions that are understood by the .NET CLR. The CLR sits on top of whatever operating system the user happens to use and translates MSIL into native instructions that are understood by the operating system.

    Anyone who has done any Java development before will find that this all sounds eerily familiar. Java programs are compiled into Java bytecode, and are then run on a Java Virtual Machine (JVM) that converts the bytecode into native operating system instructions. This design choice was made to allow Java to be a platform-independant language. In fact, any operating system for which there exists a JVM can run Java programs with no need for recompilation or porting of any kind! So naturally the first question that springs to mind about .NET, which uses the very same design pattern, is this: will .NET be a way to write Windows applications that run on multiple platforms, maybe even on Linux and MacOS X? Microsoft themselves are developing a CLR for the FreeBSD operating system, while Open Source initiatives are already underway to develop a version of the .NET platform for Linux.

    Not so fast: .NET is more than just the CLR. .NET also includes the ".NET Framework", a vast collection of class libraries that include the software components neccessary for writing graphical Windows applications, for creating dynamic Web sites with ASP.NET, and for accessing relational databases with ADO.NET, among other things. None of these class libraries will be officially available on any platform except Windows, and with non-Windows incarnations of previous Microsoft-only APIs (such as ASP 3.0 and ADO 2.5) having only just recently become practical, we can expect it will be quite some time before we see any truly useful, platform-independant applications of .NET.

    So if Microsoft didn't create the CLR to make .NET multiplatform, what's the point? One of the main features of .NET is the fact that developers have a range of programming languages to choose from. Web developers coming from ASP are likely to be most comfortable with VBScript, and .NET lets them write programs in VB.NET, a very similar (yet much more robust) language. Developers coming from more traditional software development backgrounds, who are likely to have experience with C++ and Java are offered C#. Pronounced 'C Sharp', this brand new language looks a lot like Java, but with a sprinkling of altered keywords and new syntax to help make C++ developers feel more at home.

    So what does the newly-announced J# Beta have to do with all this? Well as a seasoned Java developer exploring C# for the first time, I found the differences between the two languages to be more annoying than anything else. Everything that C# can do as a pure language Java can do just as well, often with less typing. We programmers are usually quite set in our ways; Microsoft seems to have recognized that, and created J#.

    J# ('J Sharp') takes all of the pure language syntax of Java (classes, interfaces, methods, if statements, for loops, try-catch blocks), and applies them to the .NET platform. Instead of using the javax.swing.JFrame class to create a Window, you use the .NET equivalent. Basically, J# is Java with all of the classes stripped out and replaced with the .NET Framework, including ASP.NET, ADO.NET, and the rest.

    -> Microsoft Visual J# .NET Beta 1
    http://msdn.microsoft.com/visualj/jsharp/beta.asp

    Readers with sharp memories (no pun intended) will recall that this is not the first attempt Microsoft has made at commandeering the syntax of the Java language and applying it to its own proprietary API. Microsoft Visual J++, which was confused by many early adopters of Java as just another Java development environment, contained a mix of traditional Java APIs and Microsoft Windows-specific APIs. The courts ended up barring Microsoft from pursuing the development of J++ because it infringed on Sun's right to safeguard the purity of the core Java class libraries.

    J++ was a big flop in its time, but it seems that with .NET Microsoft think the timing is right to try again. This time, however, the stakes are higher. Java is no longer an over-hyped language for writing Web applets. Today, Java is the leading platform for enterprise Web applications. If Microsoft can successfully lure developers away from the Java platform by disguising .NET with the trappings of the Java language, they'll have succeeded in doing an end run around Sun's lawyers, who may not be able to protect 'Java the language' with the same success as they were able to protect 'Java the platform'.

    Until next issue!

    - Kevin Yank
    Editor, The SitePoint Tech Times
    mailto:techitmes@sitepoint.com
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  4. #4
    SitePoint Wizard dominique's Avatar
    Join Date
    Dec 2000
    Location
    orbis terrarum
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I read that when it came out, however it still doesn't answer my question.
    J# ('J Sharp') takes all of the pure language syntax of Java (classes, interfaces, methods, if statements, for loops, try-catch blocks), and applies them to the .NET platform. Instead of using the javax.swing.JFrame class to create a Window, you use the .NET equivalent. Basically, J# is Java with all of the classes stripped out and replaced with the .NET Framework, including ASP.NET, ADO.NET, and the rest.
    As Kevin wrote himself, J# is not Java, it's merely MS's version of Java.

    There once was talk of a real (aka Sun's version of Java) Java compiler for .NET. I just wondered what happened with the plan. It may very well have been dropped in favor of J#.

  5. #5
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Anyone can develop new core modules (or whatever they're called) to extend the power of .NET. It could be done for PHP, Java, whatever you like

    As far as I know a Java project hasn't been started yet, though I have the distinct feeling it will be after .NET starts taking off.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  6. #6
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I still don't understand what you mean by "a Java compiler for .NET".

    The role of the Java compiler produced by Sun is to take Java code and convert it into Java bytecode (class files). This process has nothing to do with the Sun Java API.

    If you're talking about implementing the Sun Java API in .NET, I have to ask: what would be the point?
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  7. #7
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This might be similar to a question I asked in a simial forum. I thought MS was putting together a program that would convert Java source code into .NET compiled code.

    I guess the point would if you were considering switching to .NET and had existing Java code, it could be converted into the .NET and wouldn't disway from buying.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  8. #8
    SitePoint Wizard dominique's Avatar
    Join Date
    Dec 2000
    Location
    orbis terrarum
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by westmich
    This might be similar to a question I asked in a simial forum. I thought MS was putting together a program that would convert Java source code into .NET compiled code.

    I guess the point would if you were considering switching to .NET and had existing Java code, it could be converted into the .NET and wouldn't disway from buying.
    This pretty much sums up my question (or close enough anyway). Is anyone working on a way to make your Java code work "as is" on .NET?

    Going with J# would require you to edit all your code and change all references to Sun's API to .NET's equivalent. (Or at least that's the way I understand it. Maybe I really don't understand it )

  9. #9
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Some of the subsequent reading I did on J# .NET suggests that Microsoft are implementing many of the common classes in the Sun Java API so that they 'pass through' to the .NET equivalent. Having not experimented with J# yet myself, I can't say for sure how much (if any) of the API will be reproduced; however, I can't imagine they'll re-implement things as complex as the Swing user interface library or the Java2D drawing API...
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •