Recently I made a data management tool and encountered a "strange" problem. When running it directly in eclipse, all functions can be used normally, but exporting the jar package to the desktop won't work, some buttons are invalid, or the interface cannot be properly displayed. Record the solution and process as follows:
1. Is the exported jar package not the latest code, so I tried validate and clean up.
Result: useless!
2. decompile the exported jar package with the decompilation Tool
Result: The exported jar package code is the latest!
3. Is there an error? Although no error = is reported in eclipse
When the exported jar package runs directly, the error is not found, so it is run in DOS:
Java-jar XXX. Jar
The error message is found.
The reason is that I want to read the configuration file in my project, but the exported jar package does not export the configuration file in it, so the error "cannot find the configuration file" is reported after running ~~
This can also happen if images or other files need to be imported in the project ~
Result: The solution is successful!
The exported jar package has incomplete functions and the button clicking is invalid.