aspose file tools*
The moose likes Beginning Java and the fly likes To make a .exe file from java .class files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "To make a .exe file from java .class files" Watch "To make a .exe file from java .class files" New topic
Author

To make a .exe file from java .class files

vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170
Hi all,
How can i create a .exe file from a java .class files?
I have a A.class file and B.properties file
A.class uses B.properties file and does some operations,both the files are working fine.
How do i create a .exe file from this?

Thanks in advance,
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Hi,
this topic has been discussed many times, check it here, here and here


Hope this helps


SCJP, SCWCD.
|Asking Good Questions|
vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170
Thanks..
vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170
Hi,

I have created the jar file, as given in the example ...
When i run from the command prompt java -jar C.jar ... The output is shown.. ( i have read the file and some exceptions are shown as the file path i have put in the properties file do not exists)
When i doubleclick on the jar file , nothing happens , it just exits ..
Is this behaviour ok ?
Can the windows console come up and display the error?

Thanks,
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39828
    
  28
You get different behaviours on different platforms. Your jar is obviously all right if you get it to run from the command line. You may have problems about setting up an association, ie that if it is a .jar file, your Java runtime runs it.

I Googled and found two links, Sun and sourceforge. They are a little bit old, but they aill probably help you. I don't think you can get a console by double-clicking a .jar icon, I am afraid.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39828
    
  28
Of course, if you are getting Exceptions and nowhere to show them, the application will simply vanish. Make sure you get rid of the Exceptions first.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Hi,
if your program has nothing to do with user input or wait for event, then it will "simply exit".
You will experience the same thing with a sample "Hello World !" program.
In fact it does not simply exit, it outputs and then exits but everything happens all of a sudden (thats why we used to use getch(); in C )


Hope this helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To make a .exe file from java .class files