• Post Reply Bookmark Topic Watch Topic
  • New Topic

How i make exe file from java class file  RSS feed

 
Salman Mushtaq
Greenhorn
Posts: 27
Notepad
  • Mark post as helpful
  • send pies
  • 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 ?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi ! dear now the problem is that how i make menifest of multiple files . . . jar file ?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • 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.
 
Manoj Kumar Jain
Ranch Hand
Posts: 198
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • 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.
 
Billy Sang
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!