Java Programming Language
Java is an object-oriented programming language that can write cross-platform application software. It is a Java programming language and Java platform launched by Sun Microsystems in May 1995. (That is, the general name of JavaEE(j2ee), JavaME(j2me), JavaSE(j2se)).
Background: Others have installed jdk and configured environment variables on the Alibaba Cloud server. When I placed the jar package on the remote server, it became a compressed package. Tangled………………
#First of all, check whether the problem is caused by the development computer and server jdk version. After java -version, it was found that the server is 1.7 version, tested on another laptop with 1.7jdk installed. Follow the reference experience (the last step is not used) and select the default opening method as the javaw.exe file under jre\bin, and you can open the interface directly. The effect is as follows:
Second, check the environment variables and files on the server side
The java_home, classpath, and path settings on the server side are all correct, but the file lacks the corresponding version jre, the same version of jre is also used in the reference, not the jre in jdk, try this now.
Third, modify the default opening method
Select serverchat.jar, right-click and select [Open with], [Select the default opening program], [Browse] , pay attention to the path, select the javaw.exe file in jre under jdk, open it and confirm. At this time, serverchat.jar will display the java icon. Some computers can open it by double-clicking it. However, if the interface cannot be opened by double-clicking, continue to the next step.
Fourth, modify the registry of the javaw.exe command under root permissions
This step is also critical. I have referred to other people's blog posts to carry out this step. I used the regedit command directly without using [Open as Administrator]. The java.exe and javaw.exe folders in the registry were both empty.
To start, enter regedit in the search bar, regedit.exe will appear, select the command, right-click and select [Run as administrator], as shown in the figure below.
In the registry editor, find "HKEY_CLASSES_ROOT\Applications\javaw.exe\shell\open\command", select [Default], and right-click [Modify].
Edit to the following statement:
"C:\Program Files\java\jdk1.7.0_67\jre\bin\javaw.exe" -jar "%1"
Save and exit to achieve the second picture running effect.
In addition, we can use the command line to run the jar package. Even the compressed jar file can complete the operation, but it is not conducive to graphical operations.
java -jar C:\Users\***\Desktop\ServerChat.jar
The above is the content of Windows double-clicking the jar to be executable. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!