Jump to content
xisto Community
Sign in to follow this  
vicky99

How To Create Exe File In Java?

Recommended Posts

You have to integrate your application with a file named javaw which allows the application to be as a free independent program rather than running from the command prompt java.exeor you can make a bat file to run the program

Share this post


Link to post
Share on other sites
How to create the application run on windows?How To Create Exe File In Java?How can I create a set of Java class files to an installation set to make others can install and run those have no jvm? OrCan I make the software from java class files which have the rich interfaces?-reply by haris

Share this post


Link to post
Share on other sites
Converting Java application to EXEHow To Create Exe File In Java?

Instead of using a java exe launcher, a Java application could be compiled to native code (exe file) which doesn't require a JVM at all. One of such tools is JCGO, a Java to C translator. The produced C code is highly portable (Windows, Linux, Solaris and FreeBSD on i586 and amd64 are, at least, well supported). See more information (and the compiled sample applications) at the developer's site - http://www.ivmaisoft.com/jcgo/

-reply by ivmai

 

Share this post


Link to post
Share on other sites
exe Code Program useing 16 bit binary this is how the old com system codes workedHow To Create Exe File In Java?

for all the people out there that want to learn what exe natev code is this message is ruf and I typed it as fast as I could so if there are spelling mustakes pleaz don't be angry first off ill teach you how to for real to create a exe code in java that runs frist ill teach you string datastring data is a set of bytes read by a program or function that draws each binary code as diffrent leters so  ill teach the simpal com system that is emulated by exe code that is 16 bitdon't for get all the codes that I do are in hex60 small leters40 capital letters20 space bar0d 0a line breaknow to make letters you use the elthabet abc's you count the number of each abc a=1 b=2 c=3 you get the idea there are 26 abc's now "j" is the 10 letter in abc's now in hex its "A"now 60+A=6A makes small "j" 4A makes capital "J"now a com 16 bit code runs in ram not off the memory off the computer when you run your exe every hex or binary bits will all be writen into ram for spead becuase of the ms dos app ms dos stands for microsoft digital operating system this runs the code it starts by puting all your codes at offset address 0100 in the segment address of where your program runsthe string data in your exe will be lowcated some where in ram you can use an intrupt function to draw your string data but first you nead to set the registers to where the string data is so this int function can find the data the registers are a part of the processor of the computer that store data and flags but its limited now the int function reads the registers to find the string datanow the hex code CD is the intrupt code now if you use CD folowed by the hex code 21thats a dos intrupt code now ms dos can draw strings get the date and time right to tell CD 21what dos function to use you use the AH register in the processor witch the dos program will read and use it to tell it what function to use AH=09 print a stringAH=08 wait for key input key is stored in AL the AX register has 2 bytes AH AND AL both hold 1 byteAL is the first byte of AX AH is the Last Byte of axto change the ah value you use the hex code  B4 folowd by what to set ah toB4 09 the draw string function of the CD 21 codeB4 08 the key press function of the CD 21 codenow the DX register is used to tell the dos intrupt where the offset of the string isto set DX you find the number offset to your string then you pad it whith 0's if its not 4 in lengththen you take the 2 first  hex numbers and put them infront of the others coz the computer reads things backwordsnow to set dx to that value of yours you use  the code BA folowed by 2 hex code to the string make shere thay are in reverse oder and are paded so BA AA0A would normaly be 0AAA then take the pading out = AAA now thats all there is to itand the code CD 20 terminates your programand the end of your string should allyes end whith the code 24now I will show you how to write your first code B4 09 BA ?? ?? CD 21 B4 08 CD 21 CD 20 48 69 24 I lefft the offset to the string ?? ?? coz I will show you how to calculate itB4 09 draw sting function if you use a dos intruptBA ?? ?? offset the string string to draw if your useing the Dos IntruptCD 21 use dos IntruptB4 08 whit for key input if a dos intrupt is usedCD 21 use dos intruptCD 20 trimnate the application48 69 the letters "Hi" in ascii24 the end of the stringnow you get it native code is not that hard its only hard if you don't uderstand itwhen you run this code ever byte or hex code gos stright into the ram memory even your stringeven though the computer does not know thats a string yet untill you dos intrupt ityour app allyes gos into ram at offset 0100 becuase of sefe mode memorythe safe mode memoryof your app takes up 0100 now you add the bytes of your program to the string data to find itsoffset you count it like thisB4=109=2BA=3??=4??=5CD=621=7B4=808=9CD=1021=11CD=1220=13and this is where your string data is so 13 in hex is "D" and 0100+D=010D hex now invert the 2 hex codes to the front makes  01-0D = 0D-01 = 0D 01 so that is the offset to the string dataso the full code makesB4 09 BA 0D 01 CD 21 B4 08 CD 21 CD 20 48 69 24now you use java to write the binary of theas hex codes to the memory of your computer so you can run it

 

import javax.Swing.*;import java.Io.*;Public class hex{BufferedOutputStream bufferedOutput=null;Public hex(){WriteFile("B409BA0D01CD21B408CD21CD20486924","Exemple.Exe");}Public static void main(String[]args){new hex();}Public void WriteFile(String Hex,String f){Hex=Hex.Replace(" ","");Try{bufferedOutput=new BufferedOutputStream(new FileOutputStream(f));For(int loop=0;loop<=(Hex.Length()-1);loop=loop+2){int value=Integer.ParseInt(Hex.Substring(loop,loop+2),16);BufferedOutput.Write(value);}}catch(Exception e){}Try{if(bufferedOutput!=null){bufferedOutput.Flush();bufferedOutput.Close();}}Catch(Exception e){}JOptionPane.ShowMessageDialog(null,"Done Writeing exe File");}}

computers are not magic I uset to think thay where and plzz do not mess whith this post coz my last post on whiting bmp pictures worked but then when I go to compile it it qwit working Please leave this code for people that realy whant to lean how to write a exe with java this java file must be saved in a file named hex.Java and compiled useing the javac compiler  by damian recoskie I simplified this tutoral the besti could but I don't feal like makeing a deatiled tutoral on every function and how to use stuff that works like a if in java and bilding a game in pure native binary code I have writen a few games in binary binary is the same as hex there just numberd difrently

 

0100 in hex is 4 you calculate binary numbers like this

 8 4 2 1

 1 0 1 0=8+2=10

 1 1 0 0=8+4=12

  0 0 0 1=1

  0 0 1 0=2

  0 0 1 1=3

  0 1 0 0=4

  0 1 0 1=5

 

sound music to any kind of mead its all binary the digital signal is converted to an analog signal for sound it may sound complicated but its not by damian recoskie that is my real name

-reply by damian recoskie

 

Share this post


Link to post
Share on other sites
.EXE file in JavaHow To Create Exe File In Java?

I have a Database attached project based on Swing .. Now I want to create an .Exe which I can install through proper installation Guide(Such as when we install a .Exe of any application Software)...How can I do this??Please help me

-reply by Prithviraj

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.