Intel® Software Network Knowledge Base Wiki


Constructing Nav Tree
One Moment...

(refresh menu)



 
Welcome, Guest | Quick Login | Register

.NET


How to Compile .java Files into .Net Executables

Version 4, Changed by KEVIN PIRKL on 1/2/2008
Created by: KYLEX.S.LEWIS@INTEL.COM

Challenge

Create a .NET executable from Java* source code. Microsoft Visual J# .NET* includes an implementation of many Java Development Kit (JDK) 1.1.4* packages, including the Abstract Windowing Toolkit (AWT)*, which is used to create Graphical User Interfaces (GUIs) with the Java programming language. This functionality makes it possible for developers to build GUIs that can run unchanged on platforms such as Unix* (including Solaris* and Linux*), as well as on Windows*.

Solution

For Java source files that rely only on JDK 1.1.4 packages, use the Visual J# .NET compiler (Vjc.exe) to compile them into a .NET executable. The following commands generate an executable program called EmployeeFrame.exe:

            

vjc /target:exe /out:EmployeeFrame.exe EmployeeFrame.java

AboutDialog.java QuitDialog.java

You can run this program like any other Microsoft .NET application, using the following command:

  

EmployeeFrame.exe

Note that the Microsoft .NET Framework* has marked limitations with regard to Java functionality. For instance, Java Swing* packages cannot be used with J#, as they became available after JDK 1.1.4. Java GUI applications that employ Swing must be manually recoded to use the equivalent Windows Forms* constructs of the .NET Framework. J# also does not provide support for Java Remote Method Invocation (RMI)*, the Java Native Interface (JNI)*, Java applets*, or the ability to dynamically load Java classes from bytecode (.class) files. A separate item, "How to Convert Java* .class Files to .NET* Executables," covers creating .NET executables when the Java source code is not available.

Source

Portable GUIs Improve Application Flexibility

 



Served
23 Knowledge Bases
604 Pages
Search
Powering Up Search...


Vote on this Page

Tags For This Page
Loading Tags..

Tag This



Additional legal information