LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-29-2006, 02:59 PM   #1
Abdux
LQ Newbie
 
Registered: Jan 2006
Posts: 2

Rep: Reputation: 0
make java prog extention .exe


hello freind i wanna know to make a java program extenstion like .exe ,(it extension after being compile is .class),how can it be turned to .exe
thnx
 
Old 01-29-2006, 03:21 PM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
afaik you have to get a program to package the class into a exe.. i have never done it.. maybe trying to search google for java class to exe .. or somthing to that effect will produce results..
 
Old 01-29-2006, 08:41 PM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Why do you want it to have an extension of .exe?

You can't create a true binary unless you bundle the JRE with your application. But you can use packages to bring the code together in a convenient form. (and then compressed into a jar file)

graeme
 
Old 01-29-2006, 09:55 PM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Let's put it another way: one of the main ADVANTAGES of Java is that you have a set of platform-independent binary .class files, instead of a platform-specific .EXE. That's arguably the main POINT of having byte-codes (like Java or .Net) in the first place.

So you don't WANT to throw that advantage away - at least not without a very good reason for doing so.

Graemef is absolutely correct: if you have a simple Java application, all you have to do is ship (or better, download) a class file or two. If you have many classes, packaging them in a ".jar" file is the way to go. And there are many other options, depending on your requirements.

If, for some reason, you wanted to write in Java but still needed to turn your program into a standard, platform-specific .exe, you need to find a Java compiler. One good alternative is GCJ, the Gnu Java compiler:

http://gcc.gnu.org/java/

'Hope that helps .. PSM

Last edited by paulsm4; 01-29-2006 at 09:56 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel 2.4.24 crash after 5-10 days running 1 java prog in JRE1.5.0_04 Yodagold Debian 0 11-08-2005 09:23 AM
how to implant .exe in java applet? nickhx Programming 8 07-28-2004 03:41 AM
java prog with database keikun_naruchan Programming 1 06-29-2004 04:15 PM
How do I make an "exe" of a java file?? Laptop2250 Programming 12 03-17-2004 06:52 AM
What is the best way to call a Java program from a C prog in Linux? renato soffiatt Programming 1 10-17-2003 07:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration