views:

302

answers:

5

is there a way to compile java files into executable with high quality free software and without going through using executable JAR files?

+2  A: 

There are several ways to do it. But you should in general avoid making a java application executable on one platform just because you don't like double clicking JAR files. That defeats the purpose of interoperable nature of Java.

Spoike
Agree. A better approach is to provide a JAR file and a bunch of launchers, i.e. .bat, .sh etc
SCdF
Why was this downvoted? I thought it was quite a good point.
Kezzer
The poster wants to compile Java files into executables. What does that have to do with interoperability? He does with his Java programs what he wants.
eljenso
Just because you're providing an EXE to launch your Java program doesn't mean you don't care about interoperability. And just because you're using Java doesn't mean you DO care about interoperability either.
Mr. Shiny and New
@eljenso: In most operating systems nowadays JAR files *are* indeed executable.
Spoike
+3  A: 

Duplicate.

http://stackoverflow.com/questions/147181/how-can-i-convert-my-java-program-to-an-exe-file

eljenso
he's not asking about windows specifically,
nes1983
A: 

In others words, you want to create an EXE file from your JAR file ? There are some software for that, such as JSmooth or Launch4J

romaintaz
+1  A: 

There are several wrappers available. I have no experience with them, but you might try the following or google for some more:

Sebastian Dietz
+2  A: 

There's a nice page on Javalobby that discusses this in some detail, as well as going through several different styles you might want to do this and providing links to appropriate tools (broken down into free and commercial).

Some of the free EXE-generating tools are

  1. jstart32
  2. Launch4j
  3. JSmooth

and while I've never needed one of these so can't offer my opinion on their effectiveness, they all appear to do the simple task well.

Andrzej Doyle