This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making a .exe File.

 
Bharadwaj Adepu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have made a swing application and made an executable JAR file. Thats working properly.
But it works only in the machines which have JDK installed.
So i want to make an .exe file for that.
How can i make a .exe file. Does a exe file runs even JDK is not installed?
Tell me the process of making a .exe file.
 
Balasubramanian Chandrasekaran
Ranch Hand
Posts: 215
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bharadwaj Adepu:
I have made a swing application and made an executable JAR file. Thats working properly.
But it works only in the machines which have JDK installed.
So i want to make an .exe file for that.
How can i make a .exe file. Does a exe file runs even JDK is not installed?
Tell me the process of making a .exe file.


First thing it is not an advanced question.

I had the same query when i first joined in this forum and i got the answer.
I don't have time to personally check that one so here i point you to that thread
[ January 24, 2008: Message edited by: Balasubramanian Chandrasekaran ]
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is extremely unusual to compile Java code directly to a native executable. It's right against the spirit of Java. I don't know whether the native compiler mentioned in the linked topic really allows all Java features to be used, either.

You should take your lead from Sun, the inventors of Java, who never mention the possibility of compiling to native executables.

Much more usual would be something like Java Web Start, to manage the location and/or installation of a Java Runtime Environment (JRE). Or you could use a proper installer like InstallAnywhere, which will install the JRE with your application.

Why do you think you really want an EXE native executable file?

If you really want an EXE native executable, perhaps you shouldn't be using Java at all.
 
Petrus Pelser
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java, an executable JAR file is the EXE! But you will need the JRE installed in any case.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Petrus Pelser:
In Java, an executable JAR file is the EXE! But you will need the JRE installed in any case.


In the thread pointed to by previous poster, there was a link to a genuine native compiler for Java. This really does produce an EXE native executable, which does not need a JRE.

However, this is a very un-Java thing to do, and not recommended in all but the most specialised cases.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic