How do i convert Java .class fine into .exe file!

G

G

I know people are getting tired of answering it, and i've been
searching the web for hours, but i still don't get it! I need to
convert my .class file into native windows machine executable (.exe)
that does not require JRE. How do I do it? Does the java JDK include a
file that converts it into .exe? Thanks
 
A

Arne Vajhøj

> I know people are getting tired of answering it, and i've been
searching the web for hours, but i still don't get it! I need to
convert my .class file into native windows machine executable (.exe)
that does not require JRE. How do I do it? Does the java JDK include a
file that converts it into .exe?

The simple answer is that you don't !

You create an executable jar, let your users install JRE and
then they doubleclick on your jar and it runs.

There are various third party solution like Jet Excelsior
etc., but they are not widely used in the Java world.

Arne
 
Last edited by a moderator:
L

Lew

>> I know people are getting tired of answering it, and i've [sic] been
searching the web for hours, but i [sic] still don't get it! I need to
convert my .class file into native windows machine executable (.exe)
that does not require JRE. How do I do it? Does the java [sic] JDK include a
file that converts it into .exe?

Arne said:
The simple answer is that you don't !

You create an executable jar, let your users install JRE and
then they doubleclick on your jar and it runs.

There are various third party solution like Jet Excelsior
etc., but they are not widely used in the Java world.

To expound, if you need an .exe, don't use Java. It is not uncommon for
Windows machines to have Java installed, and not hard to get it installed when
you distribute Java programs, so the actual benefit of "executablization" of
Java programs is, at best, very questionable.

AIUI, so-called "solutions" to this so-called "problem" consist of bundling
the JRE inside the .exe itself, hardly an elegant solution. Since version
6u10, Java has gotten more clever about minimizing its footprint for the
average program, so there's really no good reason to do this anyway.

You have to download Flash to run .swf files, Word or an associated reader or
OpenOffice to read .doc files, Media Player or equivalent for .mpg, etc. What
is the big deal about downloading Java for .jar files?

Go with Arne's advice.

BTW, "Java", being a trademark, is spelled with a capital "J", and the word
"I" in English, being English, should always be capitalized. This is good
discipline for those who program in the Java language, which is case sensitive.
 
Last edited by a moderator:
A

Andrew Thompson

> ..I need to
convert my .class file into native windows machine executable (.exe)
that does not require JRE. How do I do it? Does the java JDK include a
file that converts it into .exe? Thanks

<http://pscode.org/javafaq.html#exe>

A better deployment option for this app.
might be JWS (JAva webstart), using the
deployJava.js to ensure the end user has
a suitable JRE.

Here are some basic examples of webstart
launch related to the webstart API.
<http://pscode.org/jws/>
 
Last edited by a moderator:
L

ldv

> I know people are getting tired of answering it, and i've been
searching the web for hours, but i still don't get it! I need to
convert my .class file into native windows machine executable (.exe)
that does not require JRE. How do I do it? Does thejavaJDK include a
file that converts it into .exe? Thanks

This article has all the answers:

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

LDV
 
Last edited by a moderator:
R

Roedy Green

I know people are getting tired of answering it, and i've been
searching the web for hours, but i still don't get it! I need to
convert my .class file into native windows machine executable (.exe)
that does not require JRE. How do I do it? Does the java JDK include a
file that converts it into .exe? Thanks
see http://mindprod.com/jgloss/nativecompiler.html
--
Roedy Green Canadian Mind Products
http://mindprod.com
Your old road is
Rapidly agin'.
Please get out of the new one
If you can't lend your hand
For the times they are a-changin'.
 
Last edited by a moderator:
R

Roedy Green

I need to
convert my .class file into native windows machine executable (.exe)
that does not require JRE. How do I do it? Does the java JDK include a
file that converts it into .exe? Thanks

What you probably want instead is an installer that will download and
install the JRE if it is missing, then install your app.

See http://mindprod.com/jgloss/installer.html

The catch is, you then need separate installers for each platform.

Another way to do it is to check if Java is installed with JavaScript,
and if not, display some instructions on what to do. They are not much
harder than installing an ordinary app. There is a psychological
barrier.

Consider thought that Flash, Adobe PDF need a run time too, and Users
install them without resistance. All they need is a little hand
holding.

You might try getting them installed with those ghastly OBJECT EMBED
tags.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Your old road is
Rapidly agin'.
Please get out of the new one
If you can't lend your hand
For the times they are a-changin'.
 
Last edited by a moderator:
A

Andrew Thompson

What you probably want instead is an installer that will download and
install the JRE if it is missing, then install your app.

Seehttp://mindprod.com/jgloss/installer.html

The catch is, you then need separate installers for each platform.

Another way to do it is to check if Java is installed with JavaScript,

deployJava.js is the currently recommended script,
and it completely replaces the (much despised*)..
You might try getting them installed with those ghastly OBJECT EMBED
tags.

...nested OBJECT/EMBED elements.
 
Last edited by a moderator:
G

GK

> I know people are getting tired of answering it, and i've been
searching the web for hours, but i still don't get it! I need to
convert my .class file into native windows machine executable (.exe)
that does not require JRE. How do I do it? Does the java JDK include a
file that converts it into .exe? Thanks

What about the GNU Java Compiler (gcj)?
 
Last edited by a moderator:
L

Lew

GK said:
What about the GNU Java Compiler (gcj)?

I've never been satisfied with it. It hasn't played well with standard code.
I don't know if it's current with modern Java yet; it didn't used to be. I
haven't seen evidence that it's popular. Give it a try. My information is
old. Things might've improved.

I won't bother, though.
 
J

Joshua Cranmer

Lew said:
I've never been satisfied with it. It hasn't played well with standard
code. I don't know if it's current with modern Java yet; it didn't used
to be. I haven't seen evidence that it's popular. Give it a try. My
information is old. Things might've improved.

Judging from gcj's homepage (<http://gcc.gnu.org/java/>), it now
supports "all 1.5 language features." What it still handles quite poorly
is library support, although I think OpenJDK should ameliorate that.
 
A

Arne Vajhøj

I know people are getting tired of answering it, and i've been
searching the web for hours, but i still don't get it! I need to
convert my .class file into native windows machine executable (.exe)
that does not require JRE. How do I do it? Does thejavaJDK include a
file that converts it into .exe? Thanks

This article has all the answers:

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

Considering that is is from a tool vendor, then it
is actually not that bad.

Arne
 
Last edited by a moderator:
A

Arne Vajhøj

What about the GNU Java Compiler (gcj)?

If you can live with:
- a library that is many years behind current Java
- worse performance than a modern JVM
- the occasional bug
then it is an option.

Arne
 
Last edited by a moderator:
A

Arne Vajhøj

Joshua said:
Judging from gcj's homepage (<http://gcc.gnu.org/java/>), it now
supports "all 1.5 language features." What it still handles quite poorly
is library support, although I think OpenJDK should ameliorate that.

http://builder.classpath.org/japi/jdk15-classpath.html compares
ClassPath to Java 1.5 (which is from 2004).

Their official roadmap says:

<quote>
GNU Classpath 1.0 will be fully compatible with the 1.1 and 1.2 API
specifications, in addition to having significant (>95%) compatability
with the 1.3, 1.4, 1.5 and 1.6 APIs. Our target for this release will be
to be fully API compatabile with the core of 1.5 (i.e. java.*, not
javax.*) and to have a number of significant applications (to be
determined by user input) running well. The vast majority of the 1.4 and
1.5 APIs will be available, along with a stable API for interacting with
virtual machines.
</quote>

In my book "95% compatibility" means "not compatible".

Arne
 
G

GK

If you can live with:
- a library that is many years behind current Java

You could use Sun libraries, or OpenJDK or others, i'm quite sure gcj
won't care ;-)
- worse performance than a modern JVM

The performance is obviously case dependent: http://www.stefankrause.net/wp/?p=9
(gcc 4.2.3 is used for comp., which is outdated. I always wanted to
run his tests on my machine with gcc 4.3.2 ...)
In my book "95% compatibility" means "not compatible".

I'm with you, but the missing/incompatible 5% are package javax.jws.
These don't make sense for an execetubale, doesn't it? And some of
them can't be remade because of license issues; A project adressing
that issue may be found here: http://www.gnu.org/software/classpathx/

BTW: in http://builder.classpath.org/japi/ there are a lot more
comparissons other versions and OpenJDK.

Gernot
 
A

Arne Vajhøj

GK said:
You could use Sun libraries, or OpenJDK or others, i'm quite sure gcj
won't care ;-)

If you like do to integration work.
The performance is obviously case dependent: http://www.stefankrause.net/wp/?p=9
(gcc 4.2.3 is used for comp., which is outdated. I always wanted to
run his tests on my machine with gcc 4.3.2 ...)

Benchmark results practically always depends on the benchmark used.

But since GCJ is not tested in at the page you link to, then it
does not contradict my general claim.
I'm with you, but the missing/incompatible 5% are package javax.jws.

No.

Not according to their own doc:
http://builder.classpath.org/japi/jdk15-classpath.html

Arne
 
G

GK

If you like do to integration work.

If one really wants the .exe, that could be true. Depends one your
requirements. But what do you want? There's always some work to be
done, that's why i'm sitting at my desk early in the morning :)
Benchmark results practically always depends on the benchmark used.

Yes, but humans tend to have some kind of measurement for things. And
every benchmark is an indicator for a certain area or behaviour.
But since GCJ is not tested in at the page you link to, then it
does not contradict my general claim.

You're right, but results should not differ too much, because of the
frontend/backend gcc-architecture. Sorry, can't proof that one ...

Sorry, typo: should have been: "I'm with you, but the missing/
incompatible 5% are packages like javax.jws."
There is really some seldomly used stuff on that list, but also some
important classes. The classpath hackers still have work to do.

Gernot
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top