https://github.com/devatherock/java-tutorial
Simple java tutorial project
https://github.com/devatherock/java-tutorial
Last synced: 2 months ago
JSON representation
Simple java tutorial project
- Host: GitHub
- URL: https://github.com/devatherock/java-tutorial
- Owner: devatherock
- License: mit
- Created: 2023-01-16T13:38:09.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-20T14:28:05.000Z (over 2 years ago)
- Last Synced: 2025-01-27T10:43:23.102Z (4 months ago)
- Language: Java
- Size: 58.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# java-tutorial
Java tutorial project for beginners## Setup
- Download and install [eclipse](https://www.eclipse.org/downloads/packages/release/2022-12/r/eclipse-ide-enterprise-java-and-web-developers)
- Open `Terminal`( `Cmd + Space` -> Type `Terminal` for Mac)
- Navigate to any directory where you want the code downloaded
```
cd - To enter a directory
mkdir - To create a directory
ls - To list all files in the current directory
```
- Fork the project in Github to create a copy under your username
- Clone the project from Github
```
git clone [email protected]:/java-tutorial.git
```
- Open eclipse
- In the `Select a workspace` dialog, browse to a different workspace folder if required and click `OK`
- Open the import dialog
```
File -> Import...
```
- Choose to import existing project
```
Gradle -> Existing Gradle Project -> click 'Next'
```
- In the next window, browse to the path where you cloned the project and choose the `java-tutorial` folder
- Click `Finish`## Before exercise
- In `Termial`, navigate inside `java-tutorial` folder
```
cd java-tutorial
```
- Create a new git branch named `exercise` to keep your changes separate
```
git checkout -b exercise
```## Exercise
- In eclipse, `Cmd + Shift + R`(or `Ctrl + Shift + R`) to launch the `Open Resource` dialog
- Type `HelloWorld` and open `HelloWorld.java`
- Replace the `TODO` lines with actual code## Testing
To test if the code is correct
- In `Termial`, navigate to the `java-tutorial` folder
- Run `./gradlew clean test`## To push changes from local machine to git
- Add the modified file to git
```
git add src/main/java/io/github/devatherock/javabasics/HelloWorld.java
```
- Commit the changes to local git index
```
git commit -m "feat: Completed exercise - HelloWorld"
```
- Push the branch `exercise` to remote git
```
git push origin exercise
```