Matthew Brown wrote:Hi,
What you need to do is package them up in a JAR file (basically a zip file - it stands for Java ARchive). These are then very simple to distribute.
Sun have got a fairly comprehensive tutorial here: http://java.sun.com/docs/books/tutorial/deployment/jar/index.html
Also, if you're using a modern IDE (e.g. Netbeans), it's going to be able to build the JAR file for you - check out the documentation of whatever tool you're using.
(This isn't specific to Swing or any other library, so it really ought to be in a different forum).
Mark E Hansen wrote:Java applications are run by a Java runtime. If the customer will not have Java installed on their system, then it will have to get installed somehow. Either you will have to tell them to do it, or build an installer to do it.
If Java is installed, then you can run the application from the Jar file using the "java -jar ..." command from any launching mechanism you wish to use.
Good luck.
Ankitt Gupta wrote:I don't reckon zipping it would be a complete solution as the client will still need to invoke via command line.I want that with one mouse click the application starts running.
Matthew Brown wrote:
Ankitt Gupta wrote:I don't reckon zipping it would be a complete solution as the client will still need to invoke via command line.I want that with one mouse click the application starts running.
Go through the tutorial I linked to, especially the part "Setting an Application's Entry Point".
If you've followed that approach, and they've got their computer configured so that .jar files are executed by the Java runtime, then it will run with a double-click.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:And what's the contents of MANIFEST.MF inside the JAR file?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:The JAR file is nothing more than a glorified ZIP file, and the MANIFEST.MF file in it is nothing more than a glorified text file.
Ankitt Gupta wrote:"Exception in thread "main" java.lang.NoClassDefFoundError :MyPackage/Admin (wrong name: Admin)
at .......
at....... "
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:
Ankitt Gupta wrote:"Exception in thread "main" java.lang.NoClassDefFoundError :MyPackage/Admin (wrong name: Admin)
at .......
at....... "
Wait a sec. Is your Admin class put in a package called MyPackage? Not just in the file system, but does its file start with "package MyPackage"? Please remember that Java is case sensitive, also in package names.
Jesper Young wrote:Can you show us the source code of class Admin?
Good heavens! What have you done! Here, try to fix it with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|