This repository is for messing around with Java
- System properties
- String Formatting
- Try with resources
- Maven in 5 minutes
- How to create runnable JAR file
- Build a runnable JAR in 5 minutes
- This is the only runnable JAR related resource that actually worked for me (includes command line example of running JAR)
- Download page for dos2unix
- Download page for Mockito JAR 2.0.2 beta
- Chocolatey install instructions
- Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- Install JDK
choco install jdk8 -params 'installdir=C:\\java8' -y
- Install Maven
choco install maven -y
- Install netbeans
choco install netbeans -y
- Line endings fix
Get-ChildItem -Path . -Filter '*.*' -Recurse | ForEach-Object { dos2unix.exe $_.FullName }
- Generate JDK 8 project using Maven
cmd /c mvn archetype:generate -DarchetypeArtifactId="archetype-quickstart-jdk8" -DarchetypeGroupId="com.github.ngeor"
- List contents of JAR (J-ava AR-chive file)
jar tf .\target\javafun-1.0-SNAPSHOT.jar
- Run project using command line (from repository root)
runProgram.cmd
- Make PowerShell scripts runnable
Set-ExecutionPolicy Bypass -Scope LocalMachine
- Run project using PowerShell (from repository root)
Set-ExecutionPolicy Bypass -Scope Process -Force; ./runProgram.ps1
- Quick and dirty environment setup (using Chocolatey)
choco install copyq git maven jdk11 netbeans -y
- Maven commands
mvn clean
- Delete./target
directory (previous builds)mvn install
- Create./target
directory (new build)mvn clean install
- Delete AND create./target
directory (💯 new build)mvn compile
- ???mvn assembly:single
- ???mvn jar:jar
- ???