Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To make a .exe file from java .class files

 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
this topic has been discussed many times, check it here, here and here


Hope this helps
 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..
 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48404
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48404
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic