*.java into *.exe

Hi..

I'm pretty all very very basic in Java..

And i have a program that can be quite useful for students (at least in my Uni).

Here's the deal i have 2 files a class and a main class (factor.java and factormain.java) i want to turn both files into one executable. how do i do it? please try to help without to much technical things..

I'm using netBeans IDE 5.0

thx in advance.

[417 byte] By [Pcproa] at [2007-11-26 18:50:25]
# 1

Why don't you just make it an executable JAR? you can export it from Netbeans as one. If your set on it being a .exe you still need to make it an executable JAR and then convert it to native binary using a program. Go to sourceforge and look for an app called "java 2 exe". Google for "exporting JAR netbeans" first.

kikemellya at 2007-7-9 6:24:26 > top of Java-index,Java Essentials,Java Programming...
# 2
there are some tools available to make Java programs into .exe but it pretty much defeats the whole purpose of Java program.if you want .exe files why don`t you use .Net
grilleda at 2007-7-9 6:24:26 > top of Java-index,Java Essentials,Java Programming...
# 3

I disagree about it 'defeating the whole purpose of java'

The purpose of most languages is to write useful programs, and I for one feel that if he's going to write something in java that he intends to distribute, particularly to windows, it should be something double-clickable. The last thing I want to deal with is people calling me up to say "What's a command prompt?" or "How do I type in java -jar My_Program.jar?"

To answer the question, I've seen some programs here and there that could make java programs into exe's, but none that really worked well, I don't have any links, sorry.

Shadowicsa at 2007-7-9 6:24:26 > top of Java-index,Java Essentials,Java Programming...
# 4

> I disagree about it 'defeating the whole purpose of

> java'

>

> The purpose of most languages is to write useful

> programs, and I for one feel that if he's going to

> write something in java that he intends to

> distribute, particularly to windows, it should be

> something double-clickable. The last thing I want to

> deal with is people calling me up to say "What's a

> command prompt?" or "How do I type in java -jar

> My_Program.jar?"

>

> To answer the question, I've seen some programs here

> and there that could make java programs into exe's,

> but none that really worked well, I don't have any

> links, sorry.

You can make jars double-clickable by setting your path

environment variable correctly. If you make a exe from

your jar, I think that you'll still have to set that environment

variable correctly in order for it to work by double-clicking.

So you'll anyway have to deal with people asking

"How to set environment variables?".

It might look more professional to some people to have

an exe, but I think an executable jar is fine.

I once used JSmoot to make an exe from jar, but

it's quite a hassle to get it working.

kari-matti

Message was edited by:

kari-matti

kari-mattia at 2007-7-9 6:24:26 > top of Java-index,Java Essentials,Java Programming...
# 5

Looks like I was wrong about the path relating to

double-clickable.

I found this tutorial

http://mindprod.com/jgloss/jar.html

There's a section about making jars

double-clickable. Good chances are

that modern versions of windows

already have those extensions set

up correctly.

kari-matti

kari-mattia at 2007-7-9 6:24:26 > top of Java-index,Java Essentials,Java Programming...
# 6
there is a big difference between an executable jar and an .exe and yes a .exe does defeat the purpose of java which is designed as a platform independant langauge, .exe ties it to one platform. like i said if you want a .exe why use java?
grilleda at 2007-7-9 6:24:26 > top of Java-index,Java Essentials,Java Programming...
# 7

> there is a big difference between an executable jar

> and an .exe and yes a .exe does defeat the purpose of

> java which is designed as a platform independant

> language, .exe ties it to one platform. like i said

> if you want a .exe why use java?

The language?

> ease try to help without to much technical things..

Nope, it is a technical requirement, so will require "technical things".

You most likely do not want to "convert to EXE", but make a runnable application. As others have said, JARs are "double clickable" on most windows computers (with the JRE installed), Macs, Solaris and some linux boxes.

Or you can use Java Web Start. This is an "installer" of sorts, and will put a desktop icon on the screen, a "add/remove" item to remove it and also auto-update. I highly recommend this option.

Or you could use a Java Aware installer (Install Anywhere for example).

Or you could use a Java EXE wrapper.

Or you could use a Java to native compiler (such as JET or GCC)

mlka at 2007-7-9 6:24:26 > top of Java-index,Java Essentials,Java Programming...
# 8

Oops.... so many answers some not so good... some are bad...

Got into notice this thread accidentally.... well after more than two months of the first post....

well boys go thru this link... this has all the answers needed....

http://www.excelsior-usa.com/articles/java-to-exe.html

find_suvro@SDNa at 2007-7-9 6:24:26 > top of Java-index,Java Essentials,Java Programming...