Install Java to run TOMCAT.
Install OpenJDK 11.
$ sudo apt-get install openjdk-11-jdk
Check the Java version you have installed.
$ java --version openjdk 11.0.8 2020-07-14 OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04) OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing) ~~~
Install Eclipse.
$ sudo snap install eclipse --classic
Launch Terminal on the Ubuntu desktop and launch Eclipse.
$ eclipse
Run the main menu "Help"> "Install New Software" to launch the "Install New Software" dialog.
Click the "Add" button on the right side of the "Work with" field.
Enter an arbitrary name in the "Name" field and " http://download.eclipse.org/releases/2019-12
"in the" Location "field and click the" Add "button.
Check "Programming Languages"> "C / C ++ Development Tools" and click the "Next" button.
The version information of the Eclipse CDT to be installed will be displayed. Click the "Next" button.
Accept the license agreement and press the "Finish" button.
Execute the main menu "File"> "New"> "Project" to launch the "Project" dialog.
Select "C / C ++"> "C Project" and press the "Next" button.
Enter the "Project name", select "Makefile Project"> "Empty Project" for the "Project type", select "Linux GCC" for the "Toolchains", and press the "Finish" button.
When asked "Open the C / C ++ prespective?", Press "Open Perspective".
Copy the source code to the Eclipse workspace.
$ cp -r {source code path} ~ / eclipse-workspace / ~~~
Add the following debug options to the Makefile.
CFLAGS += -O0 -g
Right-click on "Package Explorer" and execute "Refresh" to add the project tree on "Package Explorer".
Right-click on "Package Explorer" and execute "Properties" to launch the "Properties" dialog.
Open the tree node "C / C ++ Build".
Open the Builder Settings tab.
Uncheck "Use default build command".
In the Build command field, enter the make command you want to run.
Uncheck "Generate Makefiles automatically" in "Makefile generation".
Add the path with the Makefile to the Build directory.
Open the Behavior tab.
If you want to run the build on Eclipse, check "Build" and "Clean" and modify them according to the Makefile settings. If you do not want to build on Eclipse but only run or debug, uncheck "Build" and "Clean". (By default, "all" and "clean" are entered, but if you don't use them, delete them.)
Execute the Eclipse menu "Project"> "Clean".
Execute the Eclipse menu "Project"> "Build Project".
Run the menu "Run"> "Run Configurations" to launch the "Run Configurations" dialog.
Double-click the C ++ Application node to create a child node.
Open the Main tab and set the path to the executable file.
Open the Arguments tab and set the execution arguments.
Press the "Apply" button.
Press the "Run" button.
Run the menu "Run"> "Debug Configurations" to launch the "Debug Configurations" dialog.
Double-click the C ++ Application node to create a child node.
Open the Main tab and set the path to the executable file.
Open the Arguments tab and set the execution arguments.
Press the "Apply" button.
Press the "Debug" button.
Recommended Posts