Greetings and welcome to javalings
.
This project contains small exercises to get you used to reading and writing Java code.
This includes reading and responding to compiler messages!
In case you have not noticed it yet:
This project was inspired by rustlings.
javalings screenshots:
Windwos
Open PowerShell (Run as Administrator). Navigate to the location where javalings should be installed.
Then set ExecutionPolicy
to RemoteSigned
:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Then, you can run:
Start-BitsTransfer -Source https://raw.githubusercontent.com/oppahansi/javalings/main/install_javalings.ps1 -Destination $env:TMP/install_javalings.ps1; Unblock-File $env:TMP/install_javalings.ps1; Invoke-Expression $env:TMP/install_javalings.ps1
This will install the required dependencies and clone the repository in the current folder.
At the end it will clone the repository and navigate inside the javalings folder.
If you get a permission denied message, you might have to exclude the directory where you cloned javalings in your antivirus.
MacOs / Linux(Ubuntu) (NOT WORKING YET)
Navigate to the location where javalings should be installed. Then run:
curl -L https://raw.githubusercontent.com/oppahansi/javalings/main/install_javalings.sh | bash
Or if you want to pass in the path instead:
curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install_javalings.sh | bash -s mypath/
This will install the required dependencies and clone the repository in the current folder.
Once everything is done, navigate inside the javalings
folder.
Windows
Either use the installer from the oracle:
Oracle Installer
Or use a package manager:
chocolatey:
choco install openjdk --version=21.0.0
Follow the official Git installation guides
Either clone the repository:
Windows / MacOS / Linux(Ubuntu), in your preferred shell/console:
SSH
git clone [email protected]:oppahansi/javalings.git
HTTPS
git clone https://github.com/oppahansi/javalings.git
OR download the source code and extract it.
Note:
If you choose to download the source code the reset
command will not work.
reset
command needs repository cloning.
I am using ANSI characters to display colors and special characters.
To correctly display those in CMD or PowerShell you will have to enable
VirtualTerminalLevel.
Run this in powershell, not sure if admin is needed. Rerun as admin if it fails.
Set-ItemProperty HKCU:\Console VirtualTerminalLevel -Type DWORD 1
MacOs
Either use the official Oracle DMG installer
or the brew package manager:
brew install openjdk@17
Follow the official Git installation guides
Either clone the repository:
Windows / MacOS / Linux(Ubuntu), in your preferred shell/console:
SSH
git clone [email protected]:oppahansi/javalings.git
HTTPS
git clone https://github.com/oppahansi/javalings.git
OR download the source code and extract it.
Note:
If you choose to download the source code the reset
command will not work.
reset
command needs repository cloning.
Linux(Ubuntu)
sudo apt update
sudo apt install openjdk-17-jdk
Follow the official Git installation guides
Either clone the repository:
Windows / MacOS / Linux(Ubuntu), in your preferred shell/console:
SSH
git clone [email protected]:oppahansi/javalings.git
HTTPS
git clone https://github.com/oppahansi/javalings.git
OR download the source code and extract it.
Note:
If you choose to download the source code the reset
command will not work.
reset
command needs repository cloning.
Windows
All commands begin with .\javalings.bat
Linux/MacOS
It might be needed to execute chmod +x javalings.sh
and chmod +x gradlew
before you can run javalings.
All commands begin with ./javalings.sh
javalings
is a placeholder, replace it depending on your OS:
.\javalings.bat
on Windows./javalings.sh
on Linux/MacOs
Tip:
Create an alias in your shell for the above script files.
Options
javalings help
* Print all available options.
javalings watch
* Run exercises in the recommended order.
javalings list
* List all unsolved exercises.
javalings run <option>
* Options:
* exercise
* Run the specified exercise.
* next
* Run the next unsolved exercise.
* Example:
* javalings run Intro1
javalings reset <option>
* Options:
* exercise
* Reset the specified exercise.
* all
* Reset all exercises to its unsolved state.
* CAUTION, this cannot be undone.
* Example:
* javalings reset Intro1
DOES NOT WORK IF YOU DOWNLOAD THE SOURCE CODE.
RESET COMMAND NEEDS REPOSITORY CLONING.
Commands available to you during the watch mode.
Options
help
* Print all available watch mode options.
hint
* Prints a hint for the current exercise.
google
* Prints examples of what to google to find a solution.
next
* Run the next unsolved exercise.
Works only when the current exercise has been solved.
reset
* Resets the current exercise.
DOES NOT WORK IF YOU DOWNLOAD THE SOURCE CODE.
RESET COMMAND NEEDS REPOSITORY CLONING.
clear
* Clears the screen.
quit or exit
* Stops the exercise and quits javalings.
Help in any form is welcome! If you are interested in contributing to the project please
see CONTRIBUTING.md.
Alexander Schellenberg 💻 |
- help
- watch (without automatically jump to next exercise)
- list
- better display of unsolved items
- run
- reset
- help
- hint
- next
- reset
- clear
- quit or exit
- Windows
- MacOs / Linux
- intros (first version, still unsure)
- exams
- variables (first version, still unsure)
- primitive datatypes (first version, still unsure)
- strings basics
- comments
- operators
- booleans
- conditionals
- switch
- loops
- arrays
- foreach
- lists
- basic sorting of elements
- basic searching of elements
- basic summing of elements
- classes
- packages
- complex datatypes
- strings advanced
- methods
- getter setter
- imports
- enums
- interfaces
- inheritance
- polymorphism
- Method overloading / overriding
- instanceof
- stream api
- ... more coming soon
- add allcontributors bot
- rethink exercise order and structure
- watch mode optimisation? Better implementation?
- gitpod / codespaces ?
- ... more to be added