Compiling 1.1.3 on OS X and Ubuntu

Started by wootery, November 20, 2007, 00:02:14

Previous topic - Next topic

wootery

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:
Quotemkdir 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?

Matzon

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 ?

wootery

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.)



Quote from: Matzon on November 20, 2007, 06:07:39apparently the libs/junit.jar file is missing?
Please confirm that it is there
My lwjgl-source-1.1.3/libs directory is empty.

Matzon

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


wootery

Again, that works for org.lwjgl.examples.Game but not org.lwjgl.examples.spaceinvaders.Game
The errors from spaceinvaders:
Quotemzmac-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.)

Matzon

for spaceinvaders you need to have the res folder on the classpath too.

wootery

Thanks - that was the problem.

1.1.3 still doesn't compile.

Matzon

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