Java Packaged commercial software

Source: Internet
Author: User

This is the first article I wrote in my blog. Also please the great gods to teach you a lot!
I'll explain in detail how to make a Java Visual window program written by our Java Swing and AWT components into a commercially available, installable software that we can use for our users. Most of the information on the Internet is very fragmented, and after seeing it, there are often many problems that lead to the eventual failure. After three days of trying, the author summed up the following experience, and here all tidy up, hoping to help everyone. The specific green tool will also give a link below.
1. First, the author uses the IntelliJ Idea development tool, which the individual believes should be a more advanced development tool than eclipse. Because after we have installed the JDK, we can automatically detect the path of the JDK without having to configure the environment variable, so that our program can run, and there is no difficult compiler settings, we will be able to automate the code to complete the compiler, very convenient. JetBrains really did a good job in this. If you use Eclipse development tools, it doesn't matter, and the process is very similar. Follow the steps below.

2. Open your IntelliJ idea and click New Project.

2. Write your Java core code, or you can directly copy the previously written code and put it here, and then run it. See if the GUI interface that runs out is the same as the GUI interface we expected, whether it will return incorrect values, and so on. If so, please do the next step

3. Press the key combination Ctrl+shift+alt+s Enter the project structure interface, click the "+" button on the second image and select the second option.

4. Add a main function to the jar package and click OK to continue

4. If the main function has a dependent package, click the "+" button to add the dependent jar package, click OK to see the project in the Meta-info file, which contains the jar entry function information.

5. Perform a build jar operation: You can see the final generated jar file after you follow the action

in that case our jar will be ready to build. Now We can use the jar to EXE tool I made to turn it into an EXE program that can be run on someone else's computer.

One of the Baidu link is: https://pan.baidu.com/s/1nwCvI33. Click Next to generate an executable program with the suffix exe.

6. One of the most important steps is that since we've got the EXE program, how can we package our software into an installable program? Please go to 360 software center and download a free software called Inno Setup. After you have clicked countless times next, the software will automatically generate the script file, he is so hey. (Here the method is the author geeksongs own original!) This is the only family in China! Other software developers are very messy and can't use their methods at all! The way you use them won't work for the new version! Will crash the computer directly! I have suffered, so I would like to share their own methods, lest everyone make mistakes again! )

Then! Be aware of it! This script file is too low due to its applicable version! Therefore, you must make some changes in the script code below! Here, let's see the script code for the [Taks] class below. After a piece of code flags is written: unchecked! This must be wrong! The meaning of this code is: make it invisible (passive invisible, meaning you want to see and see) Because of this, we installed the software will not be in the desktop and the Start menu bar to create a shortcut yo! So all unchecked should be changed to checkablealone!. And then go ahead and see our last column of code, there's a 0,6.1 here that shows you the version of Windows. If you want to install successfully on WIN7,WIN8,WIN10, we should change it to 0,8.1! In this way, the script can be run on our new version of the computer.

7. Click on the F5 on the keyboard to get our software installation package.

8. Isn't it interesting? This way, the Java software you write can be run on someone else's computer, and can show off in front of other computer science professionals. After all, the Java language is in the sophomore semester to start learning, packaging procedures are at the graduate level will be available. If you do it in your freshman year, it's really good!

   

Java Packaged commercial software

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.