[Note] Execute java program in the integrated development environment Eclipse-I tried using git

[Note] Execute java program in the integrated development environment Eclipse-I tried using git

I installed Eclipse, an integrated development environment for the first time, and even output "Hello world!" I pushed the code to github.

I will keep it as a memorandum when using Eclipse in the future.

  1. Create a remote repository on github

  2. Press the "+ (plus)" button at the top right of the github screen and select ** New Repository **

  3. Enter the name of the repository in ** Repository name ** and press ** Create repository **

  4. Create a "new Java project"

  5. Select [File] → [New] → [Other] from the menu. When the wizard appears, select [Java Project] and click Next.

  6. Select "Yes" when the "Open the associated perspective?" Window appears.

  7. The "New Java Project" window will be displayed. Enter an arbitrary project name in the [Project Name] field and click the "Finish" button.

  8. Create a "new Java class"

  9. After creating a new project, the "Java Perspective" will be displayed. (If the "Welcome" screen is still displayed, close it)

  10. From the Eclipse menu, select [File] → [New] → [Class] to display the "New Java Class" window.

  11. Enter "Class Name" in the name. In Java, it is customary to capitalize the first letter of the class name, so give the class name an easy-to-understand alphanumeric character. Check ** public static void mail (String [] args) ** and ** Generate comment ** and click the "Finish" button.

  12. Java program description-Hello World! ~

  13. Add one line of "System.out.println (" Hello World! ");" Under (// TODO automatically generated method stub).

  14. After writing the source code, select [File] → [Save] from the Eclipse menu to save the code.

  15. Executing Java program

  16. To run the Java program, click the green "Run" icon under the Eclipse menu. (Alternatively, select [Run] → [Run] from the menu, or press the shortcut key [Ctrl + F11])

  17. When the program completes without error, "Hello World!" Is displayed in the "Console View" below.

  18. Create a Git repository (git init)

  19. Click the "Open Perspective" icon in Eclipse, or click [Window (W)]-> [Open Perspective (R)]-> [Perspective (O)]-> [Other (O)] in the Eclipse menu.

  20. Select "Git" from the "Open Perspective" window and press the "Finish" button.

  21. Creating (initializing) a new local Git repository

  22. Open the Git Perspective and click Create New Local Git Repository.

  23. Specify any folder in "Create new Git repository"-"Repository directory" and click the "Finish" button.

  24. Track Git repositories (git add)

  25. After creating a new repository, share the managed Java project with the Git repository. Click the Java Perspective icon to return to the Java project perspective you just created.

  26. Right-click in the "Java Package Explorer" view → select [Team] → [Share Project] from the menu.

  27. In the repository field of the "Configure Git repository" window, select the Git repository you created earlier and click the "Finish" button.

  28. Select the file to be tracked (the file you want to push) and click [Team] → [Add to Index] from the right-click menu. Keep track of file changes by adding Java files to the index.

  29. Commit the Git repository (git commit)

  30. The tracked file is recorded as a repository change history by "committing". In Package Explorer, select the file whose change history you want to manage and select "Team"-> "Commit" from the right-click menu.

  31. The Git Staging View is displayed, and the file you just added to the index is listed in the Staged Changes box. "Stage" is a Git term for adding to an index.

  32. To save (commit) the change history of the file, write a comment in the "commit message" and then click the "commit" button.

  33. Check the commit history. Select [Team] → [Show in History] from the right-click menu of Package Explorer. You can check the "commit ID" and "message" from the history.

  34. push

  35. Right-click on the project linked to the repository and select "Team> Remote> Push". Select the destination repository (URL automatically generated when creating the remote repository in 1.), source reference (master), and destination reference (master), and complete. This completes the push to the remote repository.

reference

From installing Eclipse to how to use it-Let's run a Java program in Eclipse! Using Git in Eclipse (4) Summarize the flow up to push.

Recommended Posts

[Note] Execute java program in the integrated development environment Eclipse-I tried using git
I stumbled when I tried using neo4j in the jenv environment, so make a note
I tried using Dapr in Java to facilitate microservice development
About the current development environment (Java 8)
I tried using JWT in Java
Build a browser test environment using Capybara in the Docker development environment
I tried using Elasticsearch API in Java
Try using the Stream API in Java
I tried the new era in Java
Java application development environment created in VM environment
Prepare Nuxt (web) + Laravel (API) development environment in the same repository using docker-compose
ChatWork4j for using the ChatWork API in Java
[Note] Struts2 environment construction using Gradle in Eclipse
Display "Hello World" in the browser using Java
Allow development in Eclipse environment using iPLAss SDK
Display "Hello World" in the browser using Java
Points stuck in building VSCode & Java development environment
Try using the COTOHA API parsing in Java
[Beginner] Install java development tool in cloud9 development environment.
Java development environment
[LeJOS] Let's program mindstorm-EV3 in Java [Environment construction part 2]
Create a Java development environment using jenv on Mac
I tried using a database connection in Android development
I tried using Google Cloud Vision API in Java
# 2 [Note] I tried to calculate multiplication tables in Java.
A note for Initializing Fields in the Java tutorial
[Java] Get the file in the jar regardless of the environment
Using the database (SQL Server 2014) from a Java program 2018/01/04
I tried using Docker because I don't want to pollute the local environment in Microsoft Teams tab development of MS Learn
I tried using an extended for statement in Java
Try global hooking in Java using the JNativeHook library
Try to build a Java development environment using Docker
I tried to implement the Euclidean algorithm in Java
Build Java program development environment with Visual Studio Code
Differences in code when using the length system in Java
Java development environment memo
java development environment construction
Template creation program when using the reminder function in slack
I tried to create a java8 development environment with Chocolatey
[LeJOS] Let's program mindstorm-EV3 in Java [Environment construction first part]
Web application development environment construction in Java (for inexperienced people)
I tried to build the environment little by little using docker
I tried using the CameraX library with Android Java Fragment
After learning Progate, I tried to make an SNS application using Rails in the local environment