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 / First Aid / February 2004

Tip: Looking for answers? Try searching our database.

how do i create an exe file in java?

Thread view: 
adam - 26 Feb 2004 08:26 GMT
i know how to make Applets, but i want to create *.exe files.
how do i do that?
a piece of code is allways wanted...
Oscar kind - 26 Feb 2004 09:51 GMT
> i know how to make Applets, but i want to create *.exe files.
> how do i do that?
> a piece of code is allways wanted...

Ideally, you don't: using a JRE is easier both for you and (in the long
run) for the user. It's also more efficient.

But if you must, see: http://www.mindprod.com/jgloss/nativecompiler.html

Oscar

Signature

Oscar Kind                                    http://home.hccnet.nl/okind/
Java/J2EE Developer                             email available on website

Tor Iver Wilhelmsen - 26 Feb 2004 17:11 GMT
> i know how to make Applets, but i want to create *.exe files.
> how do i do that?

Read the PE (Portable Executable) spec, and use a DataOutputStream to
write the data.
FISH - 26 Feb 2004 18:23 GMT
> i know how to make Applets, but i want to create *.exe files.
> how do i do that?
> a piece of code is allways wanted...

Based upon the phrasing of your question, I'm wondering whether you are
genuinely asking for a Java to native code compiler, or whether you are
simply asking how to write stand alone applications, instead of applets.

Java uses a runtime technology called a JVM - a Java Virtual Machine.
The applets you ran in your browser worked because the browser was able
to load and run a JVM (as a plugin).  To write software that does not
require a browser to run, one simply calls the JVM directly, passing it
the name of the class with a special 'main' method.  To create user
interfaces you can use classes like Frame in AWT (or JFrame in Swing)
to create windows.  The rest of the UI code looks pretty much the same
as an applet, except you are adding it to a Frame object, not an Applet.

Sun's JVM is called 'java' (or java.exe on Windows), and can be run from
a shell/DOS prompt like any other program of that type.  Running it
without any options will usually make it print some helpful usage
information.

-FISH-   ><
adam - 27 Feb 2004 09:55 GMT
> > i know how to make Applets, but i want to create *.exe files.
> > how do i do that?
[quoted text clipped - 19 lines]
>
> -FISH-   ><>

first, thank you very much for the answer.
i use kawa and the files i compile them i get .class files.
must i use the JVM
or is their a compiler that make .exe files?
Oscar kind - 27 Feb 2004 16:38 GMT
> i use kawa and the files i compile them i get .class files.
> must i use the JVM
> or is their a compiler that make .exe files?

Using the JVM is the preferred way; It's more flexible, and updates to your
program are smaller. However, if you really want to, gcj can compile java
to binaries. However, I'm not aware of a Windows version.

More information can be found in the resources section of this document:
http://www.javaworld.com/javaworld/javaqa/2000-06/02-qa-0609-exe.html

Oscar

Signature

Oscar Kind                                    http://home.hccnet.nl/okind/
Java/J2EE Developer                             email available on website



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.