• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

How i make exe file from java class file

 
Greenhorn
Posts: 27
Notepad
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ! I am Salman Mushtaq from Lahore, Pakistan and i am new here and also new in the field of programming but i love programming and advanced sorry to admin i can't find any forum to post that type of question so that i post in that forum , i make a project simply contain 3 to 4 java files in notepad , now i want to make my files in .exe file how can i do it ?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.
"exe" will tie you down to the windows platform. Instead, if you create a executable jar file, you can run it over any java supported platform. More on jar files here. http://docs.oracle.com/javase/tutorial/deployment/jar/
I will move this thread over to an appropriate forum for you
 
Salman Mushtaq
Greenhorn
Posts: 27
Notepad
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply !
Yes jar file ,,, i make it ,,, and its working ,,, more i found that post in "CODERANCH.COM" how to make jar file

Start Command Prompt.
Navigate to the folder that holds your class files:
--C:\>cd \mywork
Set path to include JDK’s bin. For example:
--C:\mywork> path c:\Program Files\Java\jdk1.5.0_09\bin;%path%
Compile your class(es):
---C:\mywork> javac *.java
Create a manifest file:
---C:\mywork> echo Main-Class: DanceStudio >manifest.txt
Create a jar file:
---C:\mywork> jar cvfm DanceStudio.jar manifest.txt *.class
Test your jar:
---C:\mywork> DanceStudio.jar
 
Salman Mushtaq
Greenhorn
Posts: 27
Notepad
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ! dear now the problem is that how i make menifest of multiple files . . . jar file ?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by a "manifest of multiple files"? A JAR file is just like a ZIP file, it can contain multiple files. The tutorial explains how to create JAR files, and what the manifest file should look like (the manifest file is the file META-INF/MANIFEST.MF inside the JAR file). In the manifest file, you specify the classpath for your program and the class that contains the main method that should be run when you run the JAR file.
 
Ranch Hand
Posts: 198
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Salman Mushtaq wrote:Hi ! dear now the problem is that how i make menifest of multiple files . . . jar file ?


If you want to wrap your executable jar file into an exe file you can do it easily by using iexpress facility from windows. write "iexpress" in start > run and hit the enter button.
This will ask for the parameters/path, Follow the simple steps and you are done.
Apart from this you can use some open source tool to create a exe from your jar file like JSmooth.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First things first, you need to make sure you have a JVM(Java Virtual Machine), which is what actually runs java executables. Then you also want to make sure you have a recent edition of the Java SDK (Software Developemnt Kit), which can be downloaded from Oracle's site. Next, you just open a command prompt on windows or a shell on linux and type the following commands,

javac filename.java
java filename

the first will compile your java file you created
then the second will run your executable
note that use just have type in the filname of your java file to run it
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic