File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Can Java run standalone / Can just load dlls ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can Java run standalone / Can just load dlls ?" Watch "Can Java run standalone / Can just load dlls ?" New topic

Can Java run standalone / Can just load dlls ?

Tomer Gal

Joined: Dec 18, 2004
Posts: 24
Hi guys
New to this forum and this is my first post.
I Got 2 questions.

- Can a Java application run standalone ?
I mean can it be converted to an .exe file for running.
I'm planning to write a commercial application and because I assume lots of newbies wont know how to run java files and wont like to mess with it thats why I'm investigating if such an application could be converted to a .exe.

- Can a Java application use .dll files ?
If the answer is yes then how...

Thanks in advanced guys
[ December 18, 2004: Message edited by: The Matrix ]
Honour Cook

Joined: Nov 01, 2004
Posts: 9
For your first question, the answer is YES. Please refer to this url to get more information.,39026606,20283101,00.htm
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
Welcome to JavaRanch, The.

Using the search link, I found that this question has been asked about 150 times or so. That's probably why it can be found 15. How do I make an .exe of my Java program? in the FAQ.

What do you have in mind when you ask about using dlls?

Please adjust your display name, The Matrix, to meet the JavaRanch Naming Policy.
You can change it here.

[ December 19, 2004: Message edited by: Marilyn de Queiroz ]

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Using JNI a java program call the methods in a dll.
[ December 19, 2004: Message edited by: srini vasan ]

Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Tomer Gal

Joined: Dec 18, 2004
Posts: 24
Thanks for the help guys, I Think I'm gonna like this place
And updated my profile with the name, have a good day all
Rajith Vidanaarachchi

Joined: Nov 06, 2004
Posts: 11
For your first question the answer is YES. You can do this using J2exe. You can download it in the internet.(There is a tutorial too)To find it search in google.
Ryan Parker

Joined: Dec 30, 2004
Posts: 1
Here's what I would do:

Option 1 (Easy)
Make a jar and a .bat file with a customized ICO icon to look like .exe app and include commands to load it.
>echo off
>java -jar <myapp.jar>

Option 2 (Tricky)
Make an .exe file using another Windows-Based language (VB,Delphi,C++) whose only job would be to execute the necessary commands in shell (e.g. shell("c:\jdk\java.exe -jar c:\myapp\myapp.jar")). So the user thinks it's an .exe (i also think that J2exe does the same thing!)

To make it more complete (in a professional way) you could also use the included Installation Wizards that VB or Delphi have to deploy your apps using a CD and prepare the necessary .bat file. In that case I would suggest including the \bin directory of your JRE version to avoid installing JRE on clients machine.

It takes some work done but it gets as standalone as possible and once done, you can use it for all your apps and if using the System UI skin (included in Java) they will never know it's Java!!!

Hope that helped

.: A few years ago, I discovered the meaning of life, but forgot to write it down... :.
I agree. Here's the link:
subject: Can Java run standalone / Can just load dlls ?
It's not a secret anymore!