I recently switched over to VS Code from Eclipse as my primary Java editor. I need to frequently export my code into a jar file which includes all libraries and dependencies for running on a Raspberry Pi. However, I currently see no obvious menus or tabs to accomplish this purpose.
Are there any extensions or built-in features which will behave in a manner similar to Eclipse's "Export" window? Would I be able to easily write a script to export for me?
If you want to export jar file then you first get maven extension installed in your vscode. In explorer of your vscode, you can find different options as shown in screenshot below.

In JAVA PROJECTS you can find option export jar(shown by right arrow). Just click on it and it will automatically create jar file of your project.
If your project has Maven, you can simply call mvn package or mvn clean install from VS Code's embedded command line.
Reference for Maven: https://cwiki.apache.org/confluence/display/MAVEN/Tutorial%3A+Build+a+JAR+file+with+Maven+in+5+minutes
For spring users in Windows type: .\mvnw package
EDIT: If you get 'mvn' is not recognized as an internal or external command, operable program or batch file., you need to: download and install mvn. Install is just setting the PATH env.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With