Creating an exe file

Ads
 

Creating an exe file

Hi All,

I have developed java application using swing by Net Beans IDE. Now I need to convert my application into exe file to run a application without intervention of Net Beans IDE. How to convert as an exe file. Please anyone suggest me.Thanks in Advance.

Thanks, T.Thanga meena

View Answers

November 11, 2011 at 1:32 PM

import java.io.*;
import java.util.zip.*;

public class CreateZip {
public static int buffer = 10240;
protected void createZipArchive(File zipFile, File[] listFiles) {
try {
byte b[] = new byte[buffer];
FileOutputStream fout = new FileOutputStream(zipFile);
ZipOutputStream out = new ZipOutputStream(fout, new Manifest());
for (int i = 0; i < listFiles.length; i++) {
if (listFiles[i] == null || !listFiles[i].exists()|| listFiles[i].isDirectory())
System.out.println("-----------------------------------");
System.out.println("Adding " + listFiles[i].getName());
ZipEntry addFiles = new ZipEntry(listFiles[i].getName());
addFiles.setTime(listFiles[i].lastModified());
out.putNextEntry(addFiles);

FileInputStream fin = new FileInputStream(listFiles[i]);
while (true) {
int len = fin.read(b, 0, b.length);
if (len <= 0)
break;
out.write(b, 0, len);
}
fin.close();
}
out.close();
fout.close();
System.out.println("Exe File is created successfully.");
} catch (Exception ex) {}
}
public static void main(String[]args){
CreateZip jar=new CreateZip();
File folder = new File("c://Examples");
File[] files = folder.listFiles();
File file=new File("C://Examples//Application.jar");
jar.createZipArchive(file, files);
}

}

November 11, 2011 at 1:32 PM

import java.io.*;
import java.util.zip.*;

public class CreateZip {
public static int buffer = 10240;
protected void createZipArchive(File zipFile, File[] listFiles) {
try {
byte b[] = new byte[buffer];
FileOutputStream fout = new FileOutputStream(zipFile);
ZipOutputStream out = new ZipOutputStream(fout, new Manifest());
for (int i = 0; i < listFiles.length; i++) {
if (listFiles[i] == null || !listFiles[i].exists()|| listFiles[i].isDirectory())
System.out.println("-----------------------------------");
System.out.println("Adding " + listFiles[i].getName());
ZipEntry addFiles = new ZipEntry(listFiles[i].getName());
addFiles.setTime(listFiles[i].lastModified());
out.putNextEntry(addFiles);

FileInputStream fin = new FileInputStream(listFiles[i]);
while (true) {
int len = fin.read(b, 0, b.length);
if (len <= 0)
break;
out.write(b, 0, len);
}
fin.close();
}
out.close();
fout.close();
System.out.println("Exe File is created successfully.");
} catch (Exception ex) {}
}
public static void main(String[]args){
CreateZip jar=new CreateZip();
File folder = new File("c://Examples");
File[] files = folder.listFiles();
File file=new File("C://Examples//Application.exe");
jar.createZipArchive(file, files);
}

}

Ads









Related Tutorials/Questions & Answers:
Creating an exe file
Creating an exe file  Hi All, I have developed java application using swing by Net Beans IDE. Now I need to convert my application into exe file... as an exe file. Please anyone suggest me.Thanks in Advance. Thanks, T.Thanga meena
how to run a .exe file in jsp
how to run a .exe file in jsp  i want code for to run a .exe file in jsp
Advertisements
conerting web project into .exe file
conerting web project into .exe file  I have creted a web project in MyEclipse 8.6 i want to convert it to .exe file how to achive
To make java exe or runnable file
To make java exe or runnable file   Helo sir i make a java application.I need to help how run application direct in pc i.e how it packaged, .exe file or setup file
how to convert a jar file into .exe file
how to convert a jar file into .exe file  hi, I want convert my jar file into executable file,urgently please help me
Creating a setup file
Creating a setup file  How to create a setup file in tomcat as done in visual studio... could plz tell me as early as possible
creating a file in a directory
creating a file in a directory  hi i have tried all the file methods to create a file inside a directory but none of them r working some of them are new File ( ".", "C:/fileInRoot.txt" ) new File ( "myDir", "/otherDir" ) File
Creating an executable jar file
Creating an executable jar file  When I try to create jar.exe through CMD, the manifest file created doesn't contain Main-Class attribute, even though it is included in text file used during creation of jar file
how to convert war file into .exe file using java code
how to convert war file into .exe file using java code  hi,I am beginner in the java,I want to convert my java maven project to .exe file,plz tell me which is required jar files and how i convert this..?Thanks in advance
How to convert many class files into one exe file?
How to convert many class files into one exe file?  How to convert class files into one exe file? I have done my project in java.i want to know how to convert it into .exe file? plz reply fast. Thnx in Advance. Happy Pongal
How to convert many class files into one exe file?
How to convert many class files into one exe file?  How to convert class files into one exe file? I have done my project in java.i want to know how to convert it into .exe file? plz reply fast. Thnx in Advance. Happy Pongal
a jsp code for creating a text file
a jsp code for creating a text file  Hello,i need jsp code for creating a new text file for each user, when they login in to the website for creating a new data file. So i need a jsp code for following options. when user login
Creating dynamic jsp file in java file to include another jsp file
Creating dynamic jsp file in java file to include another jsp file  I am able to create jsp file in java that includes ; table tr td and img tags..... Need to include jsp file in the same content. The below code doesn't help me
How to embedd jre inside the converted .exe file from .jar using Launch4J
How to embedd jre inside the converted .exe file from .jar using Launch4J  Hello Sir, I created a .exe file from the .jar file using... that jre should be embedded in the .exe file. Will you plz guide me how
problem in creating create .ipa file in my iPhone app
problem in creating create .ipa file in my iPhone app  Hi, does anyone have idea on how to create a .create .ipa file for my iPhone / iPad application? Also do i need to delete the previous build to create .ipa file? Thanks
Run a .exe from a class
Run a .exe from a class  how to lauch a .exe file from a class in Java and to check the success ful execution of the same
Creating a File I/O using import scanner, io.* and text.*
Creating a File I/O using import scanner, io.* and text.*  open a file for reading and open another file for writing data. input file hours-int, hourly rate-double, name-string. output file name-string, hours-int, hourly rate
File
File  How to create .Exe file in jana
Creating objects for classes and calling functions of a dll file using JNI
Creating objects for classes and calling functions of a dll file using JNI  Hi all, I am new to JNI. I am having a dll file created by somebody else. In this file, some c++ classes and functions are available. How can we create
run exe on remote client
run exe on remote client  I am making a client server application using netbins 6.1 , Jsp servlet, Mysql5.1... I want to run an batch file or exe file on client pc in my network if i know the username & password. I have
How to import data from sql server table into an excel file by creating the rows dynamically in the excel according to the dataabase??
How to import data from sql server table into an excel file by creating... data from sql server table into an excel file by creating the rows dynamically... to create an excel file according to that and keep updating the same
invoking exe files on sound
invoking exe files on sound  how to invoke .exe files on input as sound in java
ModuleNotFoundError: No module named 'exe'
ModuleNotFoundError: No module named 'exe'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'exe' How to remove the ModuleNotFoundError: No module named 'exe' error
ModuleNotFoundError: No module named 'exe'
ModuleNotFoundError: No module named 'exe'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'exe' How to remove the ModuleNotFoundError: No module named 'exe' error
ModuleNotFoundError: No module named 'dist-exe'
ModuleNotFoundError: No module named 'dist-exe'  Hi, My Python... 'dist-exe' How to remove the ModuleNotFoundError: No module named 'dist-exe... to install padas library. You can install dist-exe python with following
ModuleNotFoundError: No module named 'hack-exe'
ModuleNotFoundError: No module named 'hack-exe'  Hi, My Python... 'hack-exe' How to remove the ModuleNotFoundError: No module named 'hack-exe... to install padas library. You can install hack-exe python with following
ModuleNotFoundError: No module named 'run-exe'
ModuleNotFoundError: No module named 'run-exe'  Hi, My Python...-exe' How to remove the ModuleNotFoundError: No module named 'run-exe... to install padas library. You can install run-exe python with following command
ModuleNotFoundError: No module named 'run-exe'
ModuleNotFoundError: No module named 'run-exe'  Hi, My Python...-exe' How to remove the ModuleNotFoundError: No module named 'run-exe... to install padas library. You can install run-exe python with following command
Creating a Web Application with the JSF Framework
illustrates how to add JSF supporting file while creating a new web application... Creating a Web Application with the JSF Framework... by just pressing the ctrl+1 button. If you expand the Configuration file you will see
how to convert jsp to exe
to another system. so i want to convert this to exe. that will executed only internet
I am creating one jsp page in which I read in a text file, then display that data in tabular format. Now I need to calculate a total.
I am creating one jsp page in which I read in a text file, then display that data in tabular format. Now I need to calculate a total.  I am reading the file using BufferedReader, then writing the output like this: String

Ads