Installing Java + Maven
There are many ways of compiling and running java projects, but this will walk you through one of the simpler ones to use once you have it setup. You’ll be installing the JDK and Maven.
- Download the JDK installer from here
- From here, run the installer and install java. More detailed instructions are available here
- Pop a terminal and run
java -versionto make sure it’s installed properly - Next download the maven binary from here
https://maven.apache.org/download.cgi
If you are mac, I would suggest just using brew install maven if you have homebrew
- If your on windows, I would suggest following this, just take note that the version may have changed, so update accordingly
- Pop a terminal and run
mvn -vto confirm it’s downloaded successfully - Open VSCode and install the java extension pack
To create a java project
- Open VSCode
- Enter
ctrl + shift + Pand search for Java: Create Java Project - Select Maven for the project type
- Select No Archetype, or whatever archetype resembles Simple, Blank, Quickstart, Empty, Basic, no extras
- For the group id, make it
com.then something unique, its generally the reverse of a web domain, but that’s just a convention. Just make it unique so it doesn’t clash with something likecom.apple(for apple.com). For example, our team’s code will beorg.frc1511 - The artifact id will be your project name
- Then select where you want your project to be created.
- Then navigate to Main.java and press play in the top right to execute your code!