I started to learn Java today. I borrowed a book from the library from deitel. I am stuck with the above or using the command line to run Java.ProgramThere is no ide, as some beginners may need to do so, write the method. Install JDK first, and remember the installation path. Next, we need to set the environment variable. The path environment variable defines the search directory for the application.
Right-click computer> Properties> advanced system Settings> advanced> environment variables> system variables, find path, and edit
After editing, add the path D: \ tddownload \ eclipse3.5 \ jdk1.6.0 _ 16 \ bin; (this is my path) to the beginning of the environment variable. OK.
Next, open dos, win + R, and Enter cmd. Use the CD command to switch to the directory where you want to create a Java file. Then create a simple Java file.
It can be written in any text editor and saved as a. Java file after being written.
For example, creating a file welcome1.java
Public ClassWelcome1 {Public Static VoidMain (string ARGs []) {system. Out. println ("Hello, world");}}
Then, compile the javac welcome1.java command.
After compilation, you can run Java welcome1 to view the execution result.