This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

creation of exe file  RSS feed

 
avinash ramineni
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me in this
can we get an .exe file from an java application?
instead of typing java filename to get the output
avinash ramineni
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Creating an exe from a java application will make the Java Application loose its platform independence. However this can be done in one of the Integrated Development Environment.
------------------
Regds.
Rahul P. Mahindrakar
 
avinash ramineni
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul Mahindrakar:
Hi,
Creating an exe from a java application will make the Java Application loose its platform independence. However this can be done in one of the Integrated Development Environment.
hello mr.rahul
can u tell me how it can be done in an integrated development environment.hope you can answer my second question about Object Streams
u can contact me at avinash_ramineni@hotmail.com
 
Noah Carroll
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can make a java application work as if it sefl-executable by adding all necessary files to a jar file. After doing that modify the Manifest.mf file in the jar by adding the line

Main-Class: MainClassName

Now you can simply double click on the jar file, and it will run the program.
[ March 31, 2008: Message edited by: Noah Carroll ]
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you are looking for a program like JtoEXE.
Hope this helps
 
avinash ramineni
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks noah and carl
i got it. mr.noah can u be more precise with your answer .thanks once again
avinash
 
ryan headley
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also create a shortcut and on the command line of the shortcut you can put in your java command.
i.e. I used javaw.exe to run a class file that I had. I copied javaw.exe to the working directory of my class file and made the command line look like this:
c:\dev\work\javaw.exe
Then I save the shortcut, went back into properties and added the class file name at the end of the command line to look like this:
c:\dev\work\javaw.exe classfile
then I saved it. It worked fine.
ryan
 
Noah Carroll
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the command prompt(or your java IDE if it is capable) you should place all of your necessary class files into a jar file(java archive). After you have made the jar, you should update it with a new manifest.mf file. I did it by extracting the manifest.mf, modifying it by adding the line

Main-Class: mainclassname

Then when using windows(possibly other platforms, im not familiar with non-windows) you can simply double click the file icon, and it will run your program.
------------------
I hope its helps, feel free to email me noahcarroll@juno.com
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!