change java code project to exe file
hello , i'm mostafa :D :D i finished my java project of super market with a ms access database but i want to change files to exe file and use it ..i know jar files running in all environments but it need JVM , my project is consist 13 class that means 13 jar files and , i want to make them in single jar file can i ? from that i think it's easy to covert it to exe, and i don't want to lose connection with my database ..could any one tell me how :) :).
Re: change java code project to exe file
You can put all the class files and other resources the program needs in a single jar file.
I use the jar command (part of the JDK) to build and update jar files.
Re: change java code project to exe file
Thanks for your reply
i don't ask for ability of doing that i ask you to tell me how i do that
Re: change java code project to exe file
Even though it doesn't involve actually converting a jar to an executable format, programs such as AdvanceInstaller do offer nifty tools for packing your jars and resources and installing them to a default directory, be it in AppData or with other program files and then providing a shortcut to your jar in the start menu.
Re: change java code project to exe file
I use the jar command from a batch file. See the doc for the syntax of the command.
Here is one of the batch files:
Quote:
@Rem Create the SlideShowApp.jar file for standalone usage:
%DEV_DRIVE%
cd %DEV_HOME%\JavaDevelopment\SlideShow\
jar -cmf SlideShow.mnf %JAVA_RUN%\SlideShowApp.jar ImgIdxEditor.html
@REM
@REM Now go get the tools we need
@REM
cd %DEV_HOME%\JavaDevelopment\
jar -uf %JAVA_RUN%\SlideShowApp.jar SlideShow\*.class NormsTools\GetInput*.class NormsTools\GetIntInput*.class NormsTools\ShowMsgBox*.class NormsTools\MessageArea*.class NormsTools\ChoiceOfYesOrNo*.class NormsTools\ErrDialog*.class NormsTools\MakeEnterDoAction*.class NormsTools\Sorter*.class NormsTools\ArrayUtil*.class NormsTools\FindOurHome.class NormsTools\ShowListBox*.class NormsTools\SaveStdOutput*.class NormsTools\DroppedFileHandlerN*.class NormsTools\NormsDropTarget*.class NormsTools\OrderingList*.class NormsTools\DroppedFileHandler*.class NormsTools\AskMultipleChoices*.class NormsTools\GetPastes*.class
@REM Done
@Echo
@Echo Created: %JAVA_RUN%\SlideShowApp.jar
@Echo
@Echo Remember to copy jar file to C:\My_Photos when tested!
MORE
The names in % are environment varables.
Re: change java code project to exe file
Follow Norm instructions and then use Jar2Exe tool, freely avaialbe on internet to convert your jar to exe.
Re: change java code project to exe file
sorry but i need more explanation about your reply ' norm '
i couldn't understand any thing
Re: change java code project to exe file
Find the doc for the jar command. It is part of the Java SDK.
Read the doc and look at the sample batch file I posted that uses the jar command.
%DEV_DRIVE% is one of several environment variables I use to define paths to folders on my PC.
Re: change java code project to exe file
Do you want to run Java without a JVM? As far as I know, in order for a Java program to run it needs a JVM, even if it's in exe form. Take the Eclipse IDE as an example. It has an .exe version in Windows and a local-binary executable for Linux (there's no application extension in Linux). However, this is just a "dummy program" which runs Java similar to how a batch file or command script would by starting the JVM and running a jar file. Eclipse will not function without an installed JVM.
The only way to technically run Java without a JVM is on specialized hardware which would treat Java Bytecode as assembly code. I think such hardware exists on some mobile devices, but I'm not positive as many times it's just a JVM ported over to another hardware architecture (for example Android).
If you want a native application, best to start out with a natively implemented language like C or C++. For Java applications you're likely better off sticking with JAR files, web-start apps, and applets.