Installing Jena (Chenwei Zhang) Jena is an open source Semantic Web framework written in Java. In order to work with Jena we will have to ensure that Jena is properly set up on your personal computers. Unfortunately, due to current lab policy we are unable to pre-install Jenaon the Mac computers in the classroom, so we'll have to ask you all to bring your own computers to class from this week, if possible. If for whatever reason you are unable to bring a laptop to class, please inform us when possible and we will see what can be arranged. For some, setting up Jena properly may be a difficult task. Most headaches that crop up while trying to set up Jena involve either 1) the installation of Java on your computer or 2) letting Java know where the library files of Jena are located on the computer. First, you have to install the latest version of Java SE Development Kit, which you can download here:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. Note that this is different from Java Runtime Environment. If you are using Windows, please ensure that you update the PATH environment variable, adding the path to the bin folder of the Java installation, the example could be C:\Program Files\Java\jdk1.8.0_20\bin (but you might have different path on your local machine). For Linux or Mac machines the path environment should be updated automatically upon installation of Java. You can check and see if PATH is set correctly by going to the command line in Windows or the Terminal on a Unix machine and typing "java -version" (There is a space in the middle). If installed correctly, the terminal should display Java's current version. After downloading Jena and placing it somewhere on your computer you may encounter more problems when it comes to specifying, for Java, the location of Jena's library files. First and foremost, we ask that for the purposes of this class you work with Jena version 2.5.5. The latest version of Jena is 2.12.0, and you may try working with this version if you wish. However, for the sake of consistency with the course materials, 2.5.5 should be the smoothest option. You can download version 2.5.5 from this link: http://info.slis.indiana.edu/~dingying/Teaching/Z636/Slides/Jena-2.5.zip. Windows Here I first provide you the way to install Jena in Windows machine. Mac version will be provided later. We recommend that you unzip Jena to a directory that's close to your root folder, for easy access when using the command line. On my Windows computer, I unzipped Jena to C:\Jena\Jena-2.5.5\ . The tricky part in getting Jena to work correctly is assuring that Java knows where Jena's lib files are. You do this by assigning the lib folder of the Jean installation to the CLASSPATH environment variable. This can be done in the command line in Windows with the following command: set CLASSPATH=C:\Jena\Jena-2.5.5\lib\* You may need to change the actual path depending on where you decided to place the folder; your configuration should be correct as long as it points to all files in the lib folder of the Jena files. Note that both of these methods only sets the CLASSPATH variable for that terminal session only. In Windows, you can set CLASSPATH permanently by going to the System item in the Control Panel, then click on Advanced system settings, then click on the Advanced Tab, then click in Environment Variables. For Linux or Mac you could hypothetically make the CLASSPATH variable permanent by modifying your terminal bashrc file. Then you copy the "setcp.bat" from Jena tutorial slide and store it in directory C:\Jena (You just need to create a new text file and copy all the lines of setcp.bat to this file. Then rename it to "setcp.bat", Remember to change the extension. Then in the directory "C:\Jena" You type "setcp.bat C:\Jena\Jena-2.5.5\lib" Then you "cd Jena-2.5.5\echo %classpath%" Then you could run "test" to verify whether your installation is successful. If you see one error, don't worry. Mac 1.Open your Terminal. Type "java -version". If you could see something like "Java(TM) SE Runtime Environment ...", then you could go to Step 3. 2.If you could not see the sentence above, you can download the Java SE Development Kit from here:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. For Mac machines the path environment should be updated automatically upon installation of Java. Then you redo step 1 to examine the successful installation of JDK. 3.Download Jena (version 2.5.5) from this link: http://info.slis.indiana.edu/~dingying/Teaching/Z636/Slides/Jena-2.5.zip. Unzip it. Below I use my directory as an example. 4.In the Desktop, I create a folder named "Jena" and I put the above unzipped folder "Jena-2.5.5" in it. 5.In the termianl, I type "CLASSPATH=".:/Users/chenwei/Desktop/Jena/Jena-2.5.5/lib/*" Then type "export CLASSPATH". Here "chenwei" is my user name. If you do the same thing with me, you just need to replace "chenwei" by your own user name. After these steps, you should have installed your Jena successfully. Again, if you have any questions, feel free to let us know.