Hello Guest

Compiling 1.1.3 on OS X and Ubuntu

  • 7 Replies
  • 9030 Views
Compiling 1.1.3 on OS X and Ubuntu
« on: November 20, 2007, 00:02:14 »
I'm trying to compile LWJGL 1.1.3 on OS X (Tiger).
There not being any instructions for OS X, I've followed the instructions for compiling in Linux:
Quote
mkdir bin
ant generate-all
ant compile
ant compile_native
"ant generate-all" runs fine, but "ant compile" fails - to quote from where the errors begin:
Quote
[initialiazing temp/linux folder] Created dir: /Users/mz/Desktop/lwjgl-source-1.1.3/temp/native/linux
[initialiazing temp/macosx folder] Created dir: /Users/mz/Desktop/lwjgl-source-1.1.3/temp/native/macosx

compile:
     [core] Compiling 308 source files to /Users/mz/Desktop/lwjgl-source-1.1.3/bin
     [core] /Users/mz/Desktop/lwjgl-source-1.1.3/src/java/org/lwjgl/input/Controllers.java:5: package net.java.games.input does not exist
     [core] import net.java.games.input.ControllerEnvironment;
     [core]                             ^
     [core] /Users/mz/Desktop/lwjgl-source-1.1.3/src/java/org/lwjgl/input/Controllers.java:70: package net.java.games.input does not exist
     [core]     private static void createController(net.java.games.input.Controller c) {
     [core]                                                                  ^
     [core] /Users/mz/Desktop/lwjgl-source-1.1.3/src/java/org/lwjgl/input/JInputController.java:5: package net.java.games.input does not exist
     [core] import net.java.games.input.Component;
     [core]                             ^
If I try "ant compile_native" I get similar errors.
I have also tried this under Ubuntu - not any better.

What am I doing wrong?

*

Offline Matzon

  • *****
  • 2242
Re: Compiling 1.1.3 on OS X and Ubuntu
« Reply #1 on: November 20, 2007, 06:07:39 »
apparently the libs/junit.jar file is missing?
Please confirm that it is there

did you checkout the source as written in the compiling in Linux guide ?

Re: Compiling 1.1.3 on OS X and Ubuntu
« Reply #2 on: November 20, 2007, 23:19:34 »
svn compiles ok. In case this is useful to anyone else:
I got it with "svn co https://java-game-lib.svn.sourceforge.net/svnroot/java-game-lib/trunk/LWJGL lwjgl", cd'ed into that directory, and ran
ant all

I can then run the spinning square demo with
cd ./bin
java -cp /Users/mz/Desktop/new/libs/: -Djava.library.path=/Users/mz/Desktop/new/libs/macosx org.lwjgl.examples.Game

but spaceinvaders does not work, with or without -fullscreen. (I get a black window/screen.)



apparently the libs/junit.jar file is missing?
Please confirm that it is there
My lwjgl-source-1.1.3/libs directory is empty.

*

Offline Matzon

  • *****
  • 2242
Re: Compiling 1.1.3 on OS X and Ubuntu
« Reply #3 on: November 21, 2007, 06:48:51 »
if you checked out to the lwjgl folder, then you should enter that folder and do a:
java -cp bin -Djava.library.path=libs/macosx org.lwjgl.examples.Game


Re: Compiling 1.1.3 on OS X and Ubuntu
« Reply #4 on: November 21, 2007, 10:27:51 »
Again, that works for org.lwjgl.examples.Game but not org.lwjgl.examples.spaceinvaders.Game
The errors from spaceinvaders:
Quote
mzmac-osx:~/Desktop/new mz$ java -cp bin -Djava.library.path=libs/macosx org.lwjgl.examples.spaceinvaders.Game
Use -fullscreen for fullscreen mode
java.lang.NullPointerException
        at org.lwjgl.util.WaveData.create(WaveData.java:95)
        at org.lwjgl.util.WaveData.create(WaveData.java:112)
        at org.lwjgl.examples.spaceinvaders.SoundManager.addSound(SoundManager.java:154)
        at org.lwjgl.examples.spaceinvaders.Game.initialize(Game.java:242)
        at org.lwjgl.examples.spaceinvaders.Game.<init>(Game.java:179)
        at org.lwjgl.examples.spaceinvaders.Game.main(Game.java:580)
Exception in thread "main" java.lang.NullPointerException
        at org.lwjgl.examples.spaceinvaders.SoundManager.addSound(SoundManager.java:157)
        at org.lwjgl.examples.spaceinvaders.Game.initialize(Game.java:242)
        at org.lwjgl.examples.spaceinvaders.Game.<init>(Game.java:179)
        at org.lwjgl.examples.spaceinvaders.Game.main(Game.java:580)
Killed

( /Users/mz/Desktop/new/ would have been /Users/mz/Desktop/lwjgl/ , but I renamed it.)

*

Offline Matzon

  • *****
  • 2242
Re: Compiling 1.1.3 on OS X and Ubuntu
« Reply #5 on: November 21, 2007, 10:43:42 »
for spaceinvaders you need to have the res folder on the classpath too.

Re: Compiling 1.1.3 on OS X and Ubuntu
« Reply #6 on: November 21, 2007, 12:24:08 »
Thanks - that was the problem.

1.1.3 still doesn't compile.

*

Offline Matzon

  • *****
  • 2242
Re: Compiling 1.1.3 on OS X and Ubuntu
« Reply #7 on: November 21, 2007, 13:01:54 »
You need to add its dependencies (jinput most notably). These are not included in the source download, afaik. Add that file to the 1.1.3 libs folder and it will probably work.

However I think that compiling from SVN is better than using the source release - so do this instead:
svn co https://java-game-lib.svn.sourceforge.net/svnroot/java-game-lib/tags/lwjgl1.1.3/LWJGL lwjgl