|
|
|
|
![]() ![]() |
May 29 2006, 01:56 PM
Post
#1
|
|
|
Member [ Level 2 ] Group: Members Posts: 54 Joined: 28-May 06 Member No.: 13,691 |
Dear friends
I came to know that one can build exe files from java application. How this is possible? According to me there is no such method in java to cerate exe files. However Microsoft used to provide a free system development kit (SDK), for Java, which includes the jexegen tool. But one need install Microsoft Java Virtual Machine to run such application. Some people suggest InstallAnyWhere. |
|
|
|
May 29 2006, 04:31 PM
Post
#2
|
|
|
Advanced Member Group: Members Posts: 153 Joined: 8-May 06 From: Houston, TX Member No.: 13,291 |
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 |
|
|
|
May 30 2006, 04:19 AM
Post
#3
|
|
|
Member [ Level 2 ] Group: Members Posts: 54 Joined: 28-May 06 Member No.: 13,691 |
Thanks BitShift
I found JSmooth. But the problem still remains. Say for example I give a java application wrapped with JSmooth to a customer who doesn’t have internet connection. JSmooth will search for internet connection which is not present to download Java virtual machine. So he might have to install JVM manually. Therefore the problem still remains. |
|
|
|
Jun 1 2006, 01:56 PM
Post
#4
|
|
|
Guilty Until Proven Innocent Group: Members Posts: 372 Joined: 13-April 05 Member No.: 3,937 |
Thanks BitShift I found JSmooth. But the problem still remains. Say for example I give a java application wrapped with JSmooth to a customer who doesn’t have internet connection. JSmooth will search for internet connection which is not present to download Java virtual machine. So he might have to install JVM manually. Therefore the problem still remains. hi, first of all, java is not a compiled executable. you can only change how it was packed either in classes or in jar files. some offer tweaks on how to create an exe file but that is way beyond what i am to tell you. since java is not a compiled software, it needs to be parse or run in a translater which is the java virtual machine. you can have the java virtual machine packed with your distribution software and write an installer script that will also install the virtual machine. there are alot of installer scripting software available so i will not pick one. you can google on how to create an installer with executables inside that will automatically be run or setup after install. -- PS. java is just translated in order for this to run on all machines, dont use microsoft.. microsoft java runs on all machines with windows as they say but that is not true. have a microsoft java software that wont run on a certain version of windows. no problem with sun java and / or eclipse java in anyway though. ciao! |
|
|
|
Jun 1 2006, 03:45 PM
Post
#5
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 23 Joined: 18-April 06 Member No.: 12,839 |
Dear friends I came to know that one can build exe files from java application. How this is possible? According to me there is no such method in java to cerate exe files. However Microsoft used to provide a free system development kit (SDK), for Java, which includes the jexegen tool. But one need install Microsoft Java Virtual Machine to run such application. Some people suggest InstallAnyWhere. Based upon the phrasing of your question, I'm wondering whether you are genuinely asking for a Java to native code compiler, or whether you are simply asking how to write stand alone applications, instead of applets. Java uses a runtime technology called a JVM - a Java Virtual Machine. The applets you ran in your browser worked because the browser was able to load and run a JVM (as a plugin). To write software that does not require a browser to run, one simply calls the JVM directly, passing it the name of the class with a special 'main' method. To create user interfaces you can use classes like Frame in AWT (or JFrame in Swing) to create windows. The rest of the UI code looks pretty much the same as an applet, except you are adding it to a Frame object, not an Applet. Sun's JVM is called 'java' (or java.exe on Windows), and can be run from a shell/DOS prompt like any other program of that type. Running it without any options will usually make it print some helpful usage information. wojta |
|
|
|
Jun 2 2006, 06:11 AM
Post
#6
|
|
|
Advanced Member Group: Members Posts: 153 Joined: 8-May 06 From: Houston, TX Member No.: 13,291 |
Thanks BitShift I found JSmooth. But the problem still remains. Say for example I give a java application wrapped with JSmooth to a customer who doesn’t have internet connection. JSmooth will search for internet connection which is not present to download Java virtual machine. So he might have to install JVM manually. Therefore the problem still remains. I think JSmooth has an option to include the JVM and even if it doesnt im sure a program out there does, gooogle for one, im sure some1 has made 1 along the way you cant be the only 1 with this problem |
|
|
|
Jun 7 2006, 04:41 AM
Post
#7
|
|
|
Member [ Level 2 ] Group: Members Posts: 54 Joined: 28-May 06 Member No.: 13,691 |
QUOTE Based upon the phrasing of your question, I'm wondering whether you are genuinely asking for a Java to native code compiler, or whether you are simply asking how to write stand alone applications, instead of applets. Java uses a runtime technology called a JVM - a Java Virtual Machine. The applets you ran in your browser worked because the browser was able to load and run a JVM (as a plugin). To write software that does not require a browser to run, one simply calls the JVM directly, passing it the name of the class with a special 'main' method. To create user interfaces you can use classes like Frame in AWT (or JFrame in Swing) to create windows. The rest of the UI code looks pretty much the same as an applet, except you are adding it to a Frame object, not an Applet. Sun's JVM is called 'java' (or java.exe on Windows), and can be run from a shell/DOS prompt like any other program of that type. Running it without any options will usually make it print some helpful usage information. I guess you have misunderstood me. My purpose of asking this question was suppose I have built an accounting software using java and I want to sale it and if my customer does not how to install java. He might does not have even jdk rather JRE. In such cases deploying the software would be very tough. Either I have to personally install the software or the customer has to hire a professional to install the product. That is why the issue of deployment becomes as important as creation. By packing the software with installer along with the classes and JVM the deployment will be much easier and end user friendly. |
|
|
|
Jun 9 2006, 03:58 AM
Post
#8
|
|
|
Advanced Member Group: Members Posts: 153 Joined: 8-May 06 From: Houston, TX Member No.: 13,291 |
I guess you have misunderstood me. My purpose of asking this question was suppose I have built an accounting software using java and I want to sale it and if my customer does not how to install java. He might does not have even jdk rather JRE. In such cases deploying the software would be very tough. Either I have to personally install the software or the customer has to hire a professional to install the product. That is why the issue of deployment becomes as important as creation. By packing the software with installer along with the classes and JVM the deployment will be much easier and end user friendly. If this is the case then you should include a JRE that is compatible with your software when you sell it. If the program you have written needs to be installed on the users PC, in the installer you can write a script to detect to see if they have a JRE installed. If they don't you can have that installer pause and have it automatically open the installer for the JRE that you included. You should try and do something crafty like this. Also most computers come with a JRE installed now. If you look around at desktops being selled that come preinstalled with windows and other packages, almost all of them will have some version of a JRE installed, its pretty standard since so much of the web uses Java. This post has been edited by BitShift: Jun 9 2006, 04:00 AM |
|
|
|
Jun 9 2006, 06:15 AM
Post
#9
|
|
|
PsYcheDeLiC dR3aMeR Group: Admin Posts: 2,242 Joined: 29-January 05 From: Nakorn Chaisri, Thailand Member No.: 2,411 |
Yep - BitShift spelt out the correct installation method for you. There are plenty of free installer software around - one of the best being NSIS Installer, which is immensely customizable using it's own powerful scripting engine.
You should include a copy of the required JRE on your installation CD. You can easily detect the presence/absence of the JRE on the user's computer using NSIS and then fire up the JRE installer automatically if needed. You can grab NSIS at: http://nsis.sourceforge.net/Main_Page |
|
|
|
Aug 20 2006, 04:57 PM
Post
#10
|
|
|
Colonel Panic Group: [MODERATOR] Posts: 2,790 Joined: 25-March 05 From: Toronto, Ontario, Canada Member No.: 3,233 |
couldn't you just create a Shell script (in UNIX) or a .BAT file (Windows) to launch your standalone Java application?
xboxrulz |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 12th October 2008 - 02:07 AM |