Installation (Java/Processing)
Requirements
- Java 1.8 or later development environment (SDK)
Quick Install
- Go to https://cs.berry.edu/sinbad/index-java.php
- Download the latest
sinbad.jar
file to your computer. - Add the
sinbad.jar
file to the class path for whatever development environment you are using. Below are details for some common IDEs.
DrJava
- From the “Edit” menu, choose “Preferences”. Select the “Resource Locations” tab.
- In the “Extra Classpath” section, click “Add”. Locate the
sinbad.jar
file that you downloaded and click “Select”/”OK”.
You should be all set! You can use the Sinbad library with any program you write in DrJava without having to repeat these steps (as long as you don’t move the sinbad.jar
file).
Eclipse
- Right-click on your project in the Package Explorer and choose “Properties”.
- Click on “Java Build Path” and select the “Libraries” tab.
- Click the “Add External JARs…” button. Locate the
sinbad.jar
file that you downloaded and click “Select”/”OK”. - Click the “Apply and close” button in the Properties window.
You should be all set! Repeat this for each new project that you start that needs to use the library.
Processing
- In your Processing sketch, go to the “Sketch” menu and choose “Add File”.
Locate the
sinbad.jar
file that you downloaded and click “Open”/”OK”.
You should be all set! Repeat this for every sketch that needs to use the library.
Replit
(Instructions based on this post.)
- Create a new Java repl.
- Download the
sinbad.jar
file above and then upload it to the Replit environment where yourMain.java
file is (drag the jar files onto theFiles
area of the Repilt environment). (In the rest of the instructions, changeMain.java
to whatever file name yourmain
function is defined in.) - To manually compile and run the
Main.java
program, you can type the following two commands in theConsole
area (pressReturn
after typing each one):javac -classpath .:sinbad.jar -d . Main.java java -classpath.:sinbad.jar Main
This should compile and run the program, and you should see the output in the console.
- To have the Run button work with the Sinbad JAR file, create a file named
.replit
in your main Replit directory and put the following text in it:run = "export CLASSPATH=\".:sinbad.jar\"; javac -d . Main.java; java Main"
Save and close the file, and then when you press the Run button in the Replit window, it should run those two commands automatically.