Java environment setting (for all beginners)

xiaoxiao2021-03-06  87

First, why:

The Java Environmental Settings is the problem that learns Java's first step. Many articles are very complicated. In fact, three: 1. Specify the executable file path of Java in the environment variable Path; 2. Specify in environment variables Classpath Java's execution file (JAR package) path (I want to point out the JAR package name); One is because Java code is compiled, and the execution is set by the various files / bin in the installation directory. After setting up in the environment variable Path, they can be called in any directory; the second is to run Java also require library files, Java Will find it in the environment variable classpath. Second, how to set it? Other variables are good, the key is ClassPath: First of all, the directory you are in the program itself, ie.; 4.2 / lib / rt.jar ;. Third, with the difference between Linux and Windows to set up environment variables under Windows: 1> Windows set in "My Computer" "Properties" "Advanced" Environment Variables "; Linux is in ETC The / profile file is set, and the setting must be added to Export, save the file, save the file, to execute [root @ mypc] # source etc / profile 2> When multiple environment variables are set, Windows is separated, while Linux is: separated .

转载请注明原文地址:https://www.9cbs.com/read-103706.html

New Post(0)