Home | About | Account | Forums | Games
Guest   | Login
  Index  | Recent Threads  | Register  | Search  | Help  | RSS feeds  | View Unanswered Threads  
  Search  


Quick Go »
Thread Status: Normal
Forum Status: Locked
Total posts in this thread: 4
[Add To My Favorites] [Watch this Thread]
Author
Previous Thread This topic has been viewed 31994 times and has 3 replies Next Thread
Meekrat
Stranger



Joined: Dec 2, 2003
Posts: 3
Status: Offline

Building on Mac OS X

Mac OS X does something weird with their Java rt.jar. Not only is it not in $JAVA_HOME/jre/rt.jar, but it is split into classes.jar and ui.jar.

To get past the retroweaver step in the build files, I added the following to several of the build.xml files:
  <!-- Guess where the java runtime classes are for Retroweaver -->
<!-- Default for Unix -->
<property name="jre.runtime" value="/usr/local/jdk1.4/jre/lib/rt.jar"/>
<!-- if Mac OS X -->
<condition property="jre.runtime" value="/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar">
<and> <os family="mac"/> <os family="unix"/> </and>
</condition>

And replaced the first path element of retrocp with ${jre.runtime}.

Obviously, the same should be done for Windows, but I don't have a Windows box handy to look at the default install.


The last remaining conflict was in gg-client.pro, which has the line
-libraryjars <java.home>/lib/rt.jar

Not knowing anything of ProGuard and its configuration files, I just replaced it with...
-libraryjars /System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar

[Feb 23, 2007 8:09:43 AM] Show Printable Version of Post        Send Private Message [Link]  Go to top 
Meekrat
Stranger



Joined: Dec 2, 2003
Posts: 3
Status: Offline

Re: Building on Mac OS X

One more thing...

We run into the same rt.jar problem in several of the runjava and toyclient shell scripts. Not sure how to robustly detect the Unix variant. I suppose you could compare uname to "Darwin", but that will catch the Open Source Darwin kernel as well.
[Feb 23, 2007 8:16:40 AM] Show Printable Version of Post        Send Private Message [Link]  Go to top 
amabaku
Stranger



Joined: May 30, 2005
Posts: 7
Status: Offline

Re: Building on Mac OS X

So i am trying to figure out why my game is behaving so differently for me when run from the GameGardens server and my local build. And the first step was that i checked out the latest code from svn.

However I cannot get it to build on my mac.


common-webapp-prepare:

compile:
[javac] Compiling 15 source files to /Users/aric/src/gardens/projects/gardens/dist/classes
[javac] /Users/aric/src/gardens/projects/gardens/src/java/com/threerings/gardens/TemplateTest.java:10: package junit.framework does not exist
[javac] import junit.framework.Test;
[javac] ^
.
.
.



That is the first issue and i think it causes the cascade to the rest.
I tried the tips in this thread but no luck. I am not a real Java person and know nothing about ant so I am not sure where to start working to fix this.

thanks
[Mar 20, 2007 6:59:36 PM] Show Printable Version of Post        Send Private Message [Link]  Go to top 
amabaku
Stranger



Joined: May 30, 2005
Posts: 7
Status: Offline

Re: Building on Mac OS X

Sort of answering my own question but i ended up working around this.

I went into the gardens/projects directory and did an "ant all" in each of the directories there to build all the bits.

Then i looked in the gardens/projects/games/lib directory and symlinked the build .jar files here manually.

(note the README include:

narya-media.jar
narya-parlor.jar

but they should be
nenya-media.jar
vilya-parlor.jar
)

that allowed me to build my game with the latest code checked out of svn.
[Mar 20, 2007 7:51:24 PM] Show Printable Version of Post        Send Private Message [Link]  Go to top 
[Show Printable Version of Thread]

Home | About | Account | Forums | Games           ©2005 Three Rings Design, Inc