Build and Install with build.sh

The commands you’ve been typing in your terminal window can also be saved into a file; that way you can run them over and over again without having to retype them each time. We call this a shell script, and it’s another way to program the computer.

Building a plugin is only a little more complicated than compiling a single Java file as we did last chapter, but even so, it involves a lot of commands we don’t want to have to type out every time.

To make it easier, I’ve made a shell script for you named build.sh that will do the three main steps:[15]

  1. Use javac to compile the .java source to .class files.

  2. Use jar to archive the class files, manifest, and configuration file.

  3. Copy the jar file to the server. ...

Get Learn to Program with Minecraft Plugins, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.