Search This Blog

05 May 2007

Trying out jMonkeyEngine

So I decided to try out jMonkeyEngine today... I installed it, built it, and... oh wait, tests won't run. Why not? OH, cuz there is only 32-bit versions of LWJGL... Kinda lame, but OK - I'll just download the... what? There is no 64-bit versions of LWJGL? WTF? Ok, fine, I'll build that too.... Oh, it requires JInput to build... Fine, I'll... shit, got to build that too. Does nobody have xp64 built binaries? JInput requires JUtils.jar??? Oh, that's OK, I can build that one.

So here's the steps I have taken so far to unsuccessfully get jME working on my machine. And before you ask, no, I have no 32-bit machines.

Let's get some common directories here so I can shortcut them:
(JUTIL) = C:\development\cvs-devel\jutils
(JINPUT) = C:\development\cvs-devel\jinput
(M$SDK)=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
(VC++)=C:\Program Files (x86)\Microsoft Visual Studio 8\VC
(LWJGL)=C:\Java\lwjgl-1.1
(JME)=C:\development\cvs-devel\jme


Ok, start off with building (JUTIL) -- simple enough, they have an Ant script

Now, (JINPUT)\README.txt says I have to put a copy of (JUTIL)\bin\jutils.jar into (JINPUT)\coreAPI\lib and (JINPUT)\plugins\DX8\lib. They did forget to mention that their Ant build script doesn't automatically add those to the CLASSPATH, so don't forget to add it manually (I did it at the command line instead of the build script since I wanted to make sure not to screw up their script yet).

Now, (JINPUT) requires installing Visual C++ express edition (I also installed the service pack),
Windows SDK [did the AMD64 one], and the DirectX SDK. I can't tell you how annoyed I am to install a lot of Micro$oft tools in order to build a Java component. VERY annoying. Almost enough to say screw the whole lot of them and move onto something else...

Then, according to this article, I opened VC++, went into Tools | Options, into Projects and Solutions, into VC++ Directories, and added these to the appropriate sections:
Executable files: (M$SDK)\Bin
Include files: (M$SDK)\Include
Library files: (M$SDK)\Lib

Well, I know I am going to have to get 'cl.exe' on the path... so I added (VC++)\bin to my PATH environment variable. While I was at it, I moved DirectX to the end of the PATH cuz I hate when it prepends instead of appends on installation.

Ok, so let's try this again. Open a command prompt (with the new PATH variable), go into (JINPUT), add (JUTIL)\bin\jutils.jar to the CLASSPATH. ant clean. ant.


BUILD FAILED
C:\development\cvs-devel\jinput\build.xml:87: The following error occurred while executing this line:
C:\development\cvs-devel\jinput\build.xml:63: The following error occurred while executing this line:
C:\development\cvs-devel\jinput\plugins\windows\build.xml:50: The following error occurred while executing this line:
C:\development\cvs-devel\jinput\plugins\windows\src\native\build.xml:55: The following error occurred while executing this line:
C:\development\cvs-devel\jinput\plugins\windows\src\native\build.xml:10: apply returned: 128


Well, hell... what the f*)^ is 'apply returned: 128'? It's probably a return code. Quick check of the build.xml and it looks like it was trying to run 'cl.exe'. Ok, fine. 'cl.exe[ret]'...

This application has failed to start because mspdb80.dll was not found. Re-installing the application may fix this problem.

Well, hell... Ok, screw that. Start|All Programs|Visual C++ 2005 Express Edition|Visual Studio Tools|Visual Studio 2005 Command Prompt. update classpath, clean and ant.

compile_dir:
[echo] C:\development\cvs-devel\jinput\plugins\common\src\native
[apply] util.c
[apply] c:\development\cvs-devel\jinput\plugins\common\src\native\util.h(44) : fatal error C1083: Cannot open include file: 'Basetsd.h': No such file or directory

GDMF.

Ok, fine. That file is in 'C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include'... Hmmm... Put those 3 variables from before in PATH, LIB and INCLUDE.... Now PATH was obvious, but LIB and INCLUDE didn't already exist, so I hope it will be smart enough to look there. Otherwise, I might have to update the build file.

compile_dir:
[echo] C:\development\cvs-devel\jinput\plugins\wintab\src\native
[echo] wintab: C:\development\cvs-devel\jinput\plugins\wintab\src\native\${env.WINTAB_DIR}
[apply] net_java_games_input_WinTabContext.c
[apply] C:\development\cvs-devel\jinput\plugins\wintab\src\native\net_java_games_input_WinTabContext.c(6) : fatal error C1083: Cannot open include file: 'wintab.h': No such file or directory

Where the hell is that file? Screw it, I am done for today. I think it is time for breakfast or chai or.... game or something....

What steps are left?

Figure out how to get (JINPUT) built. Copy it's output into (LWJGL). Build (LWJGL) and copy its output into (JME)... Try the demos.

If anyone has prebuilt binaries for XP64, I am more than happy to uninstall all the C++ crap. I'd much rather not have any copies of Micro$oft Visual C++ on my machine.

Of course, if these components were built into the JDK, there would be no need to go through all this hassle to get a freaking Java program working. I *really* hate relying on a C++ build environment to run a Java program. Very bad plan.

1 comment:

  1. My poor Honey Bunny Butt-Butt-Head! I think you deserve a mimosa. ;-)

    ReplyDelete