On Mac, in Eclipse This article is for those who want to develop Java.
For those who want to develop with VsCode (Visual Studio Code) instead of Eclipse Please refer to "Java Development Environment (Mac, Vs Code)" in Qiita.
Eclipse is an integrated development environment It is a tool that prepares the development environment of the program with this one.
I think many people are using this Eclipse as a Java development environment.
If you haven't installed Java yet "Install Java (Mac, Homebrew, multiple version control)" Please complete the installation first by referring to.
My environment that I confirmed the operation is as follows.
OS: macOS Catalina(Version 10.15.4)
Java: 11.0.2
If you have already installed it, please skip it.
It is a set with a Japanese localization plug-in attached to the main body of Eclipse. Use Pleiades.
Download the latest version from Pleiades Site.
Next, a screen for selecting Windows or Mac, Full or Starndard, which language is displayed, so Choose the Mac Full Edition for Java.
Once the dmg file is downloaded, run it. Then, the following screen will be displayed, so Drop the Eclipse_2020-03.app icon into the Applications folder.
Launch the app file copied to the application folder. (Select Open from right-click menu)
The workspace specifies where to put the created program. Specify a location of your choice and press the launch button at the bottom right to launch Eclipse.
Once Eclipse starts Click the "Create Java Project" link in the Package Explorer on the left.
The screen for creating a new Java project will be displayed. Enter the project name, Check the Java version and Press the Finish button.
When the create module-info.java pop-up appears Press the "Do not create" button (I will not create this time)
Once you have a project From the right-click menu of the src folder in Package Explorer Select Create new class.
When the new Java class creation pop-up appears Enter a name and Check "public static void main (String [] args), Press the Finish button.
Implement the following code in main () of Main.java.
String msg = "";
msg += "Hello "
msg += "World!";
System.out.println(msg);
I intentionally forgot to write the semicolon. The error is displayed immediately.
Fill in the semicolon and save, Press the debug run button (worm icon) to run it. When the debug configuration pop-up appears, Double-click the Java application from the left menu Press the debug button when it looks like the picture below.
Double-click on the left edge of the 7th line A blue circle, which is a proof of a breakpoint, is displayed.
If you debug again in this state, the process will stop at the 7th line. When the confirmation pop-up for switching perspectives appears, press the switch button.
When you press the step over button (F6) You can move forward in the line.
How was the Java development environment construction using Eclipse on Mac?
Buttons such as Step Over and Step In when debugging I think the watch expression, call stack, breakpoints, etc. are the same as those used in other IDEs (Integrated Environments). I think that a lot of information about this area will come out if you google with "debug execution" etc., so I will omit it here.
end.
Recommended Posts