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.jarfile to your computer. - Add the
sinbad.jarfile 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.jarfile 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.jarfile 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.jarfile 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.jarfile above and then upload it to the Replit environment where yourMain.javafile is (drag the jar files onto theFilesarea of the Repilt environment). (In the rest of the instructions, changeMain.javato whatever file name yourmainfunction is defined in.) - To manually compile and run the
Main.javaprogram, you can type the following two commands in theConsolearea (pressReturnafter typing each one):javac -classpath .:sinbad.jar -d . Main.java java -classpath.:sinbad.jar MainThis 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
.replitin 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.