Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Replying to How To Create Exe File In Java?


Post Options

    • Can't make it out? Click here to generate a new image

  or Cancel


Topic Summary

Posted 01 September 2011 - 06:24 PM

.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


Posted 09 July 2010 - 12:01 AM

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

 


Posted 24 February 2010 - 08:16 PM

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 - www.Ivmaisoft.Com/jcgo/

-reply by ivmai

 


surfermac

Posted 17 October 2009 - 11:51 AM

then try to even include the jdk kit with your package so that even the java virtual machine will be present to run

Posted 10 October 2009 - 07:52 AM

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

surfermac

Posted 05 September 2009 - 01:24 PM

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.exe
or you can make a bat file to run the program

Posted 25 July 2009 - 09:26 AM

I know how to write exe files in 256 byte code but I'm not share if I trust you I will show you how to write bmp pictures in javahow to write a pictur I had a hard time I did lots of reverse engineering and hacking to figure out how to write a picture in pure computer codeAll a computer understands is numbers lolOffset   Size   Hex Value   Value Description42 4D "BM"   Magic Number (unsigned integer 66, 77)46 00 00 00   70 Bytes  Size of the BMP file00 00 Unused   Application Specific00 00 Unused   Application Specific36 00 00 00   54 bytes  The offset where the bitmap data (pixels) can be found.28 00 00 00   40 bytes  The number of bytes in the header (from this point).02 00 00 00   2 pixels  The width of the bitmap in pixels02 00 00 00   2 pixels  The height of the bitmap in pixels01 00 1 plane Number of colour planes being used.18 00 24 bits The number of bits/pixel.00 00 00 00   0   BI_RGB, No compression used10 00 00 00   16 bytes  The size of the raw BMP data (after this header)13 0B 00 00   2,835 pixels/meter  The horizontal resolution of the image13 0B 00 00   2,835 pixels/meter  The vertical resolution of the image00 00 00 00   0 colours  Number of colours in the palette00 00 00 00   0 important colours  Means all colours are importantStart of Bitmap Data00 00 FF  0 0 255 Red, Pixel (0,1)FF FF FF  255 255 255   White, Pixel (1,1)00 00 0 0  Padding for 4 byte alignment (Could be a value other than zero)FF 00 00  255 0 0 Blue, Pixel (0,0)00 FF 00  0 255 0 Green, Pixel (1,0)00 00 0 0  Padding for 4 byte alignment (Could be a value other than zeroIf you want to know more about alignment paddingIts to do with the width of your pictureLike this 5 divided 4 = 1.25 is your padding your have .25 which is 00Now remember this .25 is 00 .5 is 0000 .75 is 000000 and if 4 goes right dead on you don't need any padding or 0's after each line of coloursA bmp is written from the bottom up left to rightThe size of the raw BMP data is the Start of Bitmap Data for each set of 2 numbers it counts as 1 bite there's 16 bytes of Bitmap Data on this pictureThe offset where the bitmap data (pixels) can be found. This means how many bytes from the start of the file to where you put your bitmap dataSize of the BMP file this can be calculated by every 2 sets of numbers in the file add them together and you have the picture size in bytesA bmp is backwards in red green blue its blue green red because its how stuff is put in a computer files are mostly read backwards on computer because first number in is the last one out28 00 00 00 is how far it has to go to get to the Bitmap Data you even include this 28 00 00 00 string as 4 bytes all the way to the Bitmap Data witch is mostly 40 bytesHeres a sample code 424D AE000000 0000 0000 36000000 28000000 06000000 06000000 0100 1800 00000000 78000000 130B0000 130B0000 00000000 00000000 FFFF00 FFFF00 FFFF00 FF0000 FF0000 FF0000 0000 FFFF00 FFFF00 FFFF00 FF0000 FF0000 FF0000 0000 FFFF00 FFFF00 FFFF00 FF0000 FF0000 FF0000 0000 FF0000 FF0000 FF0000 FFFF00 FFFF00 FFFF00 0000 FF0000 FF0000 FF0000 FFFF00 FFFF00 FFFF00 0000 FF0000 FF0000 FF0000 FFFF00 FFFF00 FFFF00 0000java codeimport javax.Swing.*;import java.Io.*;Public class hex{BufferedOutputStream bufferedOutput=null;Public hex(){WriteFile("424DAE0000000000000036000000280000000600000006000000010018000000000078000000130B0000130B00000000000000000000FFFF00FFFF00FFFF00FF0000FF0000FF00000000FFFF00FFFF00FFFF00FF0000FF0000FF00000000FFFF00FFFF00FFFF00FF0000FF0000FF00000000FF0000FF0000FF0000FFFF00FFFF00FFFF000000FF0000FF0000FF0000FFFF00FFFF00FFFF000000FF0000FF0000FF0000FFFF00FFFF00FFFF000000","test.Bmp");}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(FileNotFoundException e){e.PrintStackTrace();}Catch(IOException ex){ex.PrintStackTrace();}Finally{try{if(bufferedOutput!=null){bufferedOutput.Flush();bufferedOutput.Close();}}catch(IOException e){e.PrintStackTrace();}}JOptionPane.ShowMessageDialog(null,"Done Writeing File");}}

-reply by Damian Recodkie

Posted 06 September 2008 - 07:52 AM

Try Advanced Installer
How To Create Exe File In Java?

Replying to vicky99 You can try advanced installer if you still didnt get any solution.

-reply by Triguna

Posted 15 March 2008 - 09:23 PM

The way i use is a program called JSmooth


dont know the website but you can just goooogle it



It takes all the class files and packages them in an exe file, and when executed searches for the JVM, so you still need to have the JVM on the users computer, but it also has an option to include the JVM ( that would be a big file )

anyways check it out, might suit your needs as long as ur programs arent too big....


note: i think there is a big in there, you might have to put all ur class files in jar files and have it read them from the jar file for it to work correctly, you might even have to set up the manifest in the jar file to make it be able to execute as a jar if you want it to execute as an exe, not sure though you should test around with it




I dont even know what he means by that Lol

Posted 26 February 2008 - 11:37 AM

how to connect an .EXE file through java environment
How To Create Exe File In Java?

Hello friends,

I want to connect an EXE file of cisco software PACKET TRACER using java program, if anyone of you have an idea then please share with me.

Thanks

-question by vidhu jauhri

Review the complete topic (launches new window)