Maybe someone know how to make an executable JAR?i've made a JAR before and there always notification that i must choose the mainclass?although i was choosing the main class in METAINF.MF file?
java has no executables if the .jar was execuatable, it would no longerbe a .jar.to make a runable jar,create a jar called MyJarHave a class inside called MyJarInside that have a main().
Jar is not an executable, but can act as one. Define in the manifest.mffile the following lines:Manifest-Version: 1.0Created-By: 1.4.0 (Sun Microsystems Inc.)Main-Class: your.main.class.with.packageThere is also some other tools to create an executable for java.Take a look at http://www.excelsior-usa.com/jetlatest.html
while associating jar files with javaw don't forget to give -jar option e.g."C:\Program Files\Java\j2re1.4.0_01\bin\javaw.exe" -jar "%1"
it still isnt executable as such is it.the contents of the jar is still the same, its just got a fileassociation on a local computer. it wont have that association on othercomputers will it. so nothing has changed.i suspect the OP is new to java for this type of question.
i try to read in java SDK documents and i've found chapter about "executable JarFiles" in "\j2sdk1.4.0\docs\guide\jar\jarGuide.html"it says:On Win32 systems the Java 2 Runtime Environment's installation program willregister a default association for jar files so that double-clicking a Jar fileon the desktop will automatically run it with javaw -jar. Dependent extensionsbundled with the application will also be loaded automatically. This featuremakes the end-user runtime environment easier to use on Win32 systemsand this executable was only able for Win32 and Solaris 2.6 kernel.so i try it and it work. thank you for your appreciation