Installing Sunflow



Sunflow is a Java program, so you need to have Java installed in order to run it. You need Java 1.5 (sometimes called 5.0) or newer - older versions will not work. Versions of Java other than those from Sun are not supported and may not work.


You will get the best performance with Java 6.

Server VM

Sunflow will run considerably faster with the so called server VM (Virtual Machine). This server VM is part of Java, but it's not included in the standard (JRE) installation of Java. The server VM starts up more slowly and uses more memory than the standard VM, but it runs a lot faster in many cases.

Sunflow's built in realtime raytracing benchmark (-rtbench) for example runs more than twice as fast with the server VM (exact speedup depends on your hardware).

The easiest way to get the server VM is by installing the Java Development Kit (JDK). You can get it here: Download the plain JDK 6, you won't need the version with Java EE or NetBeans.

Note: The 64-bit version of Java already includes the server VM. OS X also ships with the server JVM by default.


After downloading the binary version of Sunflow, just unzip the file into a directory of your choice.

Running Sunflow

When running sunflow, you need to pass some parameters to Java, in order to increase performance. For this purpose, it's most convenient to create a batch or script file.


Creating a batch file for starting Sunflow

Make sure you know where your JDK is installed. By default, this will be something like c:\program files\java\jdk1.6.0.

Now open notepad or the text editor of your choice and paste the following text there:

@set javadir="c:\program files\java\jdk1.6.0"
@set mem=1G
@%javadir%\bin\java -Xmx%mem% -server -jar sunflow.jar %*
@if %errorlevel% neq 0 pause

You may need to change the part which is marked, put the path of your Java installation there!


  • The first line sets a variable with the path to your JDK installation directory. Make sure there is no space at the end of the line, or before the equals sign!
  • The second line sets the maximum amount of memory available to Sunflow. Sunflow won't necessarily use that much, it's just the upper limit. Java's default for this value is just 64 MB, which isn't enough for anything but simple scenes.You can use values like 512M, 1G, 2G...
    Sunflow will display a warning if you give it less than 800 MB.
  • The third line starts Sunflow with the necessary parameters, as well as any additional parameters you may have specified at the command line.
    If you really want to run Sunflow without the server VM, you need to remove the -server switch here. Sunflow will display a warning if you start it without using the server VM.
  • The last line checks for the result, and displays a prompt to press any key if something went wrong.

Save this file with the name sunflow.bat to the directory where you unzipped Sunflow.

Starting the GUI

You can now start the Sunflow GUI (Graphical User Interface) by executing the sunflow.bat you created.

Rendering from the command line

You can also use sunflow.bat to render from the command line, without the GUI. For example, sunflow -rtbench will start the built-in real time raytracing benchmark.

Call Sunflow with the parameter -h for a complete list of command line parameters and their meanings.

OS X/Linux/Unix

If you are unsure of how to access the command line and navigate around it - check out the following tutorial. This applies to OS X users only - if you are running a Linux (or similar) operating system you are probably already very familiar with this.

Most of the instructions for Windows users also apply to OS X and Linux, except that you must create a sunflow script with the following content:

java -Xmx$mem -server -jar sunflow.jar $*

Note that this script assumes java is in your path. This should be the case by default on recent versions of OS X. Linux users should be able to find out easily where they've installed Java. As before, if when you run the script without arguments the GUI shows up without any warnings - everything is working correctly.

Don't forget to set the executabe bit on the script (chmod +x sunflow) and to run it as: ./sunflow.

Your first render

The binary release of Sunflow doesn't include any example scenes. You can download example scenes from the homepage.

If you just want to see if it works, you can also run the built-in real time raytracing benchmark, by calling sunflow with the parameter -rtbench on the command line.


Common error messages

The system cannot find the path specified. The path to your Java installation is wrong, check it again. Make sure there's no space around the equals sign in that line of sunflow.bat
'......' is not recognized as an internal or external command, operable program or batch file. There's probably a typo in your sunflow.bat, or an extra space at the end of the line where the java directory is defined.
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
If you get a message like this, the memory setting in your sunflow.bat is too high.
Error: no `server' JVM at `c:\program files\java\jre1.6.0\bin\server\jvm.dll'. This error message means that the server VM was not found. This usually means that the path you specified is not pointing to a JDK installation, or that you didn't install the server VM. Check the path again, make sure you installed the JDK, or if you really want to run without the server VM, remove the -server parameter from sunflow.bat. Logo Valid XHTML 1.1 Valid CSS!

Website design by Kristoffer Berg (MUX medialab)