Welcome Guest.   Make a donation to an author on the site July 25, 2014, 03:26:11 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Learn about the DonationCoder.com microdonation system (DonationCredits).
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Java to exe converters  (Read 9923 times)
arunpawar
Participant
*
Posts: 60


View Profile Give some DonationCredits to this forum member
« on: March 14, 2008, 06:06:38 AM »

Is there any quick and easy way to create an executable file from java source files?
As using .jar files sucks many users can't understand what it is and there is supposed to be a way if we're targetting java programs for widnows only users.I know creating exe will take away the mere purpose of java program but what if i want to make it available for windows user (who knows only clicking on exe file to run program).Jar file and webstart methods are tried earlier but they're not what i want,also i tried most of the google search.

I also came across blog which explains not to create exe,instead create webstart and jar file for users.But i want to know is there any  native compiler for this,a dn how we can create java to exe using this.MANY google searches are being forwarded to such blogs who dont recommend this way,why people hate to create EXE for windows users.

plz let me knw if any tricks are there.
Logged
tinjaw
Supporting Member
**
Posts: 1,926



I'm so glad breakbeat techno isn't an illegal drug

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: March 14, 2008, 08:28:19 AM »

The short answer is that you don't want to do that. I'll try to explain why.

But i want to know is there any  native compiler for this,a dn how we can create java to exe using this.

You cannot do this. jar files contain code that is compiled already, but compiled to byte code. This is then run on the Java Virtual Machine that knows how to interact with the underlying operating system.

Technically, what you are looking for is a cross-compiler. One that takes java source code and cross compiles it to something like C++ object code so it can be compiled to native windows code.

Yes, the preferred way is to use webstart. However, if you want an exe, I would suggest the following. Use Auto IT or AutoHotKey and create a exe that just calls java.exe (or javaw.exe) and passes it the jar file as a parameter. This would allow you to maintain the java as a jar file (so it can be invoked the "normal" way) and still have an exe for the "other" users.
Logged

 
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: March 14, 2008, 09:17:16 AM »

There's nothing that really stops anybody from creating a JAVA compiler that does native output, even if the language was designed to create binary portable output. GNU is doing this with their gcj project, for instance. And you could also still compile to .jar format, but bundle with a JVM into a .exe - iirc this was possible with Microsoft's Visual J++, but that was discontinued because of pressure from SUN.

But the best general solution is probably to follow Tinjaw's advice smiley
Logged

- carpe noctem
arunpawar
Participant
*
Posts: 60


View Profile Give some DonationCredits to this forum member
« Reply #3 on: March 15, 2008, 01:41:45 AM »

there are plenty of projects like processing,wiring and swarm who uses java and let you create create .exe of their respective scripts,but actually as they are dependent to their own projects.
i have asked many developers on their forums but the core develoeprs are not online so they're yet to answer the question that how java code is compiled into exe.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: March 15, 2008, 06:56:31 AM »

Maybe this will do?
Logged

tinjaw
Supporting Member
**
Posts: 1,926



I'm so glad breakbeat techno isn't an illegal drug

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: March 15, 2008, 07:12:10 PM »

Maybe this will do?

I hadn't seen that before. That looks nice.
Logged

 
agentsteal
Honorary Member
**
Posts: 75



View Profile Give some DonationCredits to this forum member
« Reply #6 on: December 01, 2008, 08:20:51 PM »

This program converts .jar to .exe:
http://www.mpowers.net/executor/
Logged
mahesh2k
Supporting Member
**
Posts: 1,406



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: January 17, 2009, 01:08:07 PM »

http://www.regexlab.com/en/jar2exe/ (Not free but It does the Job.)

http://jsmooth.sourceforge.net/ (Free)


Logged
MagicGuy52
Supporting Member
**
Posts: 1


View Profile Give some DonationCredits to this forum member
« Reply #8 on: December 29, 2012, 01:48:40 PM »

Personally I have always wanted to make a native code single executable which didn't require an installer.
I have researched pretty thoroughly on this topic and these are my results:

1.Native code compilation is pretty much counter-productive to the main purpose of Java(platform independent language).

2.Because of this there are not many ways to do it.

3. The best surviving two are Excelsior Jet and the GCC.

4. I have as of yet been unable to get the latter to work and the former seems to only allow one to make an exe which requires their custom jre (one or two files).

5. No solution I have found yet(excluding the gcc about which I don't know) makes true native code independent of an rte. The best you can seem to do is make an installer for the program and the rte.

6.At long last I found what seems to be the closest thing to what I want.

Basically you use Excelsior Jet to compile the code with their custom rte and then use 7-zip to package the exe and the rte into a new exe.  

It won't be lightning fast, but it will do what you want.
Logged
mouser
First Author
Administrator
*****
Posts: 33,180



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: December 29, 2012, 03:03:12 PM »

Welcome to the site MagicGuy  thumbs up
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.041s | Server load: 0.01 ]