First create a folder where you will clone the repo.
For Windows
- Download Openjdk17 https://jdk.java.net/17/.
- Extract the file.
- Create a folder in C:\Program Files\Java\
- Move the jdk-17.0.1.jdk file into the folder
- Set the path (for windows)
- Select Control Panel and then System.
- Click Advanced and then Environment Variables.
- Select path -> edit -> New -> browse -> jdk-17.0.1.jdk -> bin
- Set correct version of Java in your preferred IDE
For Mac (Using Homebrew and Jenv)
- Download Openjdk17 https://jdk.java.net/17/.
- Open Terminal
- Go to folder where jdk17 is
cd <where you have downloaded OpenJDK17>
- Move folder to /Library/Java/JavaVirtualMachines/
sudo mv jdk-17.0.1.jdk /Library/Java/JavaVirtualMachines/
- Close and reopen terminal
- Install home brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Jenv
brew install jenv
- Check if you have bash or zsh do
echo $SHELL
.
Bash
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(jenv init -)"' >> ~/.bash_profile
Zsh
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(jenv init -)"' >> ~/.zshrc
- Add to Jenv
jenv add /System/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
jenv versions
- Go to folder where you will be storing your git repos on your machine
jenv local 17
- Check version of java in that directory
java -version
For Mac (Manually setting the path) https://knasmueller.net/how-to-install-java-openjdk-17-on-macos-big-sur
- Follow steps in link but for setting the path do the following depending on what your computer uses.
- Check if you have bash or zsh do
echo $SHELL
.
Bash
echo -n "\nexport JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home" >> ~/.bash_profile
Zsh
echo -n "\nexport JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home" >> ~/.zshrc
- Install git for windows https://git-scm.com/downloads
- Control panel -> Systems and security -> System -> Advanced System settings -> Advanced -> environment variables -> Select path -> edit -> New -> browse -> git folder -> bin
(Alternatively you could use Git Desktop to manage your repo but the follow instructions are for commandline prompts)
- Use commandline and go inside your git folder
git clone https://github.com/Featherdusk9/MinecraftMod.git
cd MinecraftMod
git checkout -b <name>-dev
for examplegit checkout -b vib-dev
This creates a new branchgit pull
to make sure the branch is up to date- You can use
git branch
to see all the branches you have on your local machine - You can use
git status
to see any changes that have been made to files
To Push Changes
git status
to see your changesgit add .
to add all your changesgit commit -m "<your message>"
to commit your changesgit push origin <name of your local branch>
to push changes- Go to Git on the web and create a pull request
- Add one reviewer to look over what changes you've made
- Merge after reviewed
- Notify others to pull when master has been changed
- First before adding project to IDE go to command line
- Go to folder where MinecraftMod is
- If on Windows
gradlew gen<name of IDE>Runs
for example (gradlew genEclipseRuns) (gradlew genIntellijRuns) (gradlew genVSCodeRuns)
- If on Mac
./gradlew gen<name of IDE>Runs
for example (./gradlew genEclipseRuns) (./gradlew genIntellijRuns) (./gradlew genVSCodeRuns)
- If using Eclipse do
gradlew eclipse
or./gradlew eclipse
Eclipse https://www.eclipse.org/downloads/
- When first launching Eclipse: Java 11 + Vm should be 17.0.1
- Go to Preferences -> Java -> Installed JREs
- Make sure it is set to a version of Java 17
- Import Project
- gradle -> existing project -> Browse folder
- Find the folder of MinecraftMod
- next -> Override workspace settings
- Make sure Gradle Wrapper is selected
- Select Java home -> browse -> your folder that java 17 is stored in
- Make sure preview loads so that it means that no errors will occur
- Finish
- Go to run configurations
- Click on Java Application
- To run program select runClient
Intellij https://www.jetbrains.com/idea/download/#section=windows
- Open and browse for MinecraftMod folder
- If prompted select Gradle Project
- Right Click Project and select Project Structure
- Make sure Project SDK is some version of Java 17
VSCode https://code.visualstudio.com/download
- Get Java Extension Pack
- Open and browse for MinecraftMod folder
- Confirm the version of Java used in VSCode
- Run without debugging to run program