Skip to content
This repository was archived by the owner on Jun 12, 2019. It is now read-only.
pdinklag edited this page Sep 3, 2012 · 4 revisions

This first chapter is a very rough guide on how to setup a JSFML project.

  • Advanced users: Just put jsfml.jar into your classpath and skip this.
  • Beginners: This page is not going to wrap it all up for you, but it might point you in the right direction.

Download

First off, you will need to download JSFML. Go ahead and grab the latest version of JSFML. (lies! there is no JSFML release yet. :( ).

The key component of JSFML is the file jsfml.jar. For the sake of standards, place it in a directory called lib in your project.

Project setup

Setup a project like you would for any Java project.

In case you never did that, this page might not be suitable for you just yet. You will have to go through the epic struggle of choosing an IDE that suits you best (if any) and how to create a basic Java project.

Here are a few links to the sites of common IDEs that might help you get started:

Setting the Classpath

Once you got a project set up, you will need to add JSFML to the classpath.

The classpath, for those who don't know, is - very roughly speaking - a list of locations from where Java will look for classes. By default, it only looks from where you currently are located at. The Nanyang Technological University of Singapore has a nice article explaining classpaths in a much more detailled manner.

You need to add the file jsfml.jar, the JSFML library file that you should already have downloaded by now, to your classpath. How to this exactly depends on the IDE that you use (if any), so refrain to its documentation if you don't know how to do this.

Done!

Well, that's all!

JSFML has its binaries packed inside the JAR and they will automagically be extracted as needed when JSFML classes are used. In case you wonder, they are extracted into the .jsfml directory in your user directory. If another (older or newer) version of JSFML is already present in there, it will be overriden. This ensures that your application will always use the very JSFML version that you packed up with it.

To make sure everything works fine, go ahead to the next chapter and create a basic window application.

Clone this wiki locally