JSDL for Sparc Solaris

Using Binary

Using Source

Using  the Binary


To demonstrate the portability of JSDL, I took 3 hours and built a version for Sparc Solaris.  The current developer distribution was based on a custom SDL build that installs in /usr/local2.

Video: ENABLED I have only built it to run on X11, and have not tried to get it to work with the framebuffer at console.  However, Sun was the the first to come up with the early fb device, so hopefully we should be able to get it to work.
Audio: DISABLED I didn't build SDL to support audio.
Extension - SDLImage : ENABLED Works, but need other dependencies
Extension - SMpeg :  DISABLED not compiled in.
Extension - SFont : ENABLED

Installing Developer Binary Distribution

To allow users to test JSDL on Solaris, I have posted a zip file containing a binary version of JSDL.
  1. Download http://jsdl.sourceforge.net/dist/jsdl_usr_dist_${DATE}_SunOS_sparc.zip
  2. unzip jsdl_usr_dist_${DATE}_SunOS_sparc.zip

Installing Dependency Binary Distribution.

JSDL was built against a fresh install of libSDL and SDL extensions.  It includes lib
Remember, audio and SMpeg and not built into this distribution.
  1. Download http://jsdl.sourceforge.net/dist/SMSsdl-0.4.beta-sparc-local2.bz2
  2. bzip2 -d SMSsdl-0.4.beta-sparc-local2
  3. pkgadd -d SMSsdl-0.4.beta-sparc-local2
The package libraries were compiled to run from /usr/local2.  If you change this path, the binary distribution will not work. Below is an output of /usr/local2/lib

libSDL-1.2.so.0            libjpeg.a
libSDL-1.2.so.0.0.4        libpng.a
libSDL.a                   libpng.so
libSDL.la                  libpng.so.3
libSDL.so                  libpng.so.
libSDL_image-1.2.so.0      libpng12.a
libSDL_image-1.2.so.0.1.2  libpng12.so
libSDL_image.a             libpng12.so.0
libSDL_image.la            libpng12.so.

Configuring Development Environment

JSDL on Solaris requires the following LD_LIBRARY_PATH values


When testing SDL, you must specify the proper "java.library.path" and it is always helpful to dump the "jni" debug information.

java -verbose:jni -Djava.library.path=${JSDL_BASE}:/usr/local2/lib:${SOLARIS_LIB}:/usr/lib -classpath .:$JSDL_BASE sdl.test.TestAnim

Don't be surprised when you see SMpeg related errors.  The SMpeg stuff is not built into this libary.

Using the Source

Rebuilding JNI

The key part of bulding JSDL for Solaris is ensuring the dependencies are in place so you can build the JNI parts against them.  If you want to go through the trouble of reinstalling everything yourself, here's what I did.

Compiling Dependencies

Several dependencies must be installed before you can build JSDL

Building libSDL

Before you build libSDL, you must run configure with the following option
./configure --enable-video-x11

I had problems with x11 not being linked into the final libJava4SDL.so library.  If you get "no display device available", this is probably it.

Building SDL_Image

SDL_Image requires jpeg and png libraries to work.  You may either install the binary distributions from www.sunfreeware.com or build the packages yourself.  Either way, they must be in your LD_LIBRARY_PATH prior to building SDL_Image.

Building SMpeg

Can't say much about this.  I brought over the sources and the build went fine without any errors or warnings. However, near the very end, gcc stopped, complaining it ran out of memory.  If someone gets this to work on their compiler let me know.  In order to get set up for building SMpeg, you need the following

automake, autoconf, m4, perl

If you get these from http://www.sunfreeware.com, be sure to use their version of perl.  They built the autoconf packages to refer to /usr/local/perl.

SMPeg support will not work until this is fixed.

Bring over CVS

Bring over the CVS source as described in the CVS section of the JSDL homepage.

Modify compileJNI.sh script

Currently, the native build parts of JSDL is limited to one shell script

jsdl/sdl/jni/compilejni.sh.  You must modify this script to reflect the location of Java, libSDL, and other dependencies.

When you invoke compilejni.sh, you will see errors when you get to SMpeg, but the library will still be built and copied to jsdl/dist/lib.  

Run ant

Now we are ready to recompile the java parts against our JSDL native library.  Ensure Jakarta "Ant" is in your path, navigate to the CVS root where "build.xml" is located and type ant.

The end result should be the following jar: "jsdl/dist/lib/jsdl.jar".  

Good luck!