I am developing a software in Java Swing which i want to sell it to a client.I have written all the source code.I have put the .class files in one folder
The problem is that i don't know to wrap it up and give the complete set up to the client so that he can install it without any intricacies.Please help me out
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).
Note that if you want to ship everything in one file (including data files, images, sound, what have you) then you can't access those files via java.io.File et al.- you need to use the classloader resource mechanism.
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).
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.
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
Ranch Hand
Joined: Feb 19, 2009
Posts: 101
posted
0
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.
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.
Ankitt Gupta
Ranch Hand
Joined: Feb 19, 2009
Posts: 101
posted
0
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.
I modified the Manifest.txt but still it is giving an exception when i invoke from command line
That suggests to me that either the Manifest file isn't correct or (more likely) the internal structure of the JAR file isn't correct. I can't be more precise without knowing exactly what you've done.
If your main class is MyPackage.Admin, then the file Admin.class needs to be in a folder MyPackage within the JAR file.
hi,
i just sold my simple application software written in java and i use third party software to wrap my class files,
you can use jar2exe to hide your source code and provide an executable file for your main class
edit: P.S. its only for windows ^^
Ankitt Gupta
Ranch Hand
Joined: Feb 19, 2009
Posts: 101
posted
0
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....... "
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.
Ankitt Gupta
Ranch Hand
Joined: Feb 19, 2009
Posts: 101
posted
0
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.