Doing a desktop application (set the Spring boot environment), involves the TCP connection, I want to in the application is opened automatically enter the IP address and port number (IP address and port number can also change in interface)
As shown in figure:
After the running of the idea, can read and write data from the properties and normal but cannot read and write data after the packaged into a jar, this how to solve? Or what better way to store the IP address and port number?
CodePudding user response:
The read and write an external configuration file (.ini, properties), and 127.0.0.1 is not accessed nodes outside of the machineCodePudding user response:
Can check the packaging and see if the properties is playing out of the jar in the bagCodePudding user response: