Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-07-2008, 05:05 PM   PM User | #1
Inquisit
New Coder

 
Join Date: Aug 2008
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Inquisit is an unknown quantity at this point
Question Converting.java to .exe ?

Question

Is there a way to Convert a .java file to an exe file

i use NetBean 6 and i have a source folder in that src folder

a main java project file .java (1) 1 file

individual.java files (2) files

now i want to convert this source folder with all the.java files to one .exe file to run under native Windows OS

i have softwares such as

JSmooth

EXE4J



i dont know how to do this in either 1 if there's a way i can convert that whole folder to an exe file would be very helpful
for the completion of my software


Solutions are welcome
thanks
Inquisit is offline   Reply With Quote
Old 10-07-2008, 07:25 PM   PM User | #2
shadowmaniac
Regular Coder

 
Join Date: Apr 2005
Location: Ohio
Posts: 254
Thanks: 1
Thanked 63 Times in 63 Posts
shadowmaniac is an unknown quantity at this point
Haven't tried it myself but this seems pretty straight forward:
Quote:
2.2. Creating your first exe

Building your own EXE wrapper for your java application just needs a few simple steps: specify the name of the executable, define the main java class, optionally a classpath if it needs more than its own jar, and that's all.
2.2.1. Quick Start

The minimum data you need to start the creation of the binary executable for your application is to specify a classpath and the fully-qualified name of your main class. You can configure both in the Application panel (add new jars or directories using the icon with a yellow + sign, and type the class name in the Main Class field.

Once done, go to the Windows Executable panel, and type the name of the executable in the Executable Name field. Do not forget to add the .exe suffix, for your executable name. Something like my-app.exe should be fine.

Of course, you can specify many more options for the java wrapper, but this is enough for a basic java application. Now, click on the save button (or in the File+Save menu) and select a filename for the project. This is an important step, because all the path stored in the file, and displayed in the GUI are relative to this project file. Selecting a location under the root directory of your project is a good (and safe) choice.

Once your project is saved, it is just a matter of clicking on the Project+Create Exe. And that's it. You can use the Project+Run Exe to run the program, or use the windows explorer to run the executable.
Source: http://jsmooth.sourceforge.net/docs/...oc.html#N100B0
shadowmaniac is offline   Reply With Quote
Users who have thanked shadowmaniac for this post:
Inquisit (10-08-2008)
Old 10-07-2008, 10:10 PM   PM User | #3
Aradon
Moderator-san


 
Aradon's Avatar
 
Join Date: Jun 2005
Location: USA
Posts: 734
Thanks: 0
Thanked 20 Times in 19 Posts
Aradon is on a distinguished road
Most windows come with the JRE, if this is the case you shouldn't be creating an exe, but instead should be creating a jar file. JAR files are like exe's, but for Java only!

http://java.sun.com/docs/books/tutorial/deployment/jar/
__________________
"To iterate is human, to recurse divine." -L. Peter Deutsch
Aradon is offline   Reply With Quote
Users who have thanked Aradon for this post:
Inquisit (10-08-2008)
Old 10-08-2008, 12:25 AM   PM User | #4
Inquisit
New Coder

 
Join Date: Aug 2008
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Inquisit is an unknown quantity at this point
Thanks im on it right now
Inquisit is offline   Reply With Quote
Old 10-08-2008, 12:28 AM   PM User | #5
Inquisit
New Coder

 
Join Date: Aug 2008
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Inquisit is an unknown quantity at this point
Jar files need a JRE or IDE to run thats the disadvantage but with .exe it can be accessed anytime anywhere....

thnaks appreciate your help on this one D..
Inquisit is offline   Reply With Quote
Old 10-08-2008, 04:53 AM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I'd have to disagree. An .exe will only work for the framework it was developed for - a Windows .exe is unlikely to be executable on Linux for example. This is why Java is advantageous with the JRE, so the bytecode can be dynamically interpreted by the host system. This takes the specific architecture away from the developer, making applications more portable. This is one of the advantages that Java has over C# (which will only run to its full extent on a Windows machine). The .NET framework also uses the MIL, so its taking the same approach to the interpreter as Java does.
This of course, ignores emulations like cygwin and wine. If you want to make executable files, use C/C++.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Old 10-08-2008, 08:47 PM   PM User | #7
Inquisit
New Coder

 
Join Date: Aug 2008
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Inquisit is an unknown quantity at this point
Thumbs up

all the same then is it possible converting to C" from .java then to exe from C# if you know of any software?

anyways thanks though was helpful
Inquisit is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:08 AM.


Advertisement
Log in to turn off these ads.