What is the best way to make a Java Application executable?

S

Steven J Sobol

Andrew Thompson said:

That describes reasons not to compile Java bytecode into native code. However,
I don't see any compelling reason not to wrap an app in a Windows or other
executable that fires up the JVM and launches your app via JNI. The question
is, which was C-man talking about: compiling to native code, or using an
exe wrapper? If the former, I'd agree with your reply. If the latter, not.
 
A

Andrew Thompson

I don't see any compelling reason not to wrap an app in a Windows or other
executable that fires up the JVM and launches your app via JNI.

How about these three..
a) non-portability
b) extra overhead
c) lack of need (no advantages over JWS)
 
J

Jacob

C-man said:
What is the best way to make a Java Application executable?

A .jar file with an appropriate manifest file *is* an
executable, and should (in principle) run perfectly on
any platform. The exact approach for starting the
application may differ (on MS/Windows or Solaris you
double click on the .jar or write its name as a command
in a console window), and you might need to do some
OS setup adjustments to set it up correctly.

Remember that the Java runtime environment (JRE) must be
available on the client machine in order for a Java
application to run. This is the price for platform
independency, but as an application programmer this is
not really of your concern.
 
S

Steven J Sobol

Andrew Thompson said:
How about these three..
a) non-portability
b) extra overhead
c) lack of need (no advantages over JWS)

I like to use exe4j because it allows the exe to automatically set up its
classpath, find the VM, etc., but mostly because it's nice to be able to
search for the program in the Windows task manager, so I can see what kind
of resources it's using, and not have to wade through a dozen javaw.exe
processes (the task manager will show the name of the exe instead). I'd have
the same reasons for doing something similar on a Unix box.

I certainly wouldn't do it because it's portable.
 
V

Victor Chew

I tend to agree. I use NativeJ to wrap some common Java apps that I use
on a daily basis (jEdit, nntprss). It is definitely nicer than having to
muck around with batch files and environment variables, plus I can use
Win32 services when I need them (eg. for nntprss).

I even got jEdit set up so that everything (including preferences and
extensions) are stored on a USB drive. That way, I can use it across my
home and office machines. Nice!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top