Skip to main content

build hdcookbook on Mac OS X 10.5 (Intel)

10 replies [Last post]
oliverlietz
Offline
Joined: 2007-09-30
Points: 0

- download and install Java SE 6 Developer Preview 9
(from http://developer.apple.com/java/download/)

- link CurrentJDK to 1.6 in /System/Library/Frameworks/JavaVM.framework/Versions

- adjust HDC_BDJ_PLATFORM_CLASSES in vars.properties:
HDC_BDJ_PLATFORM_CLASSES=/[...]/classes.jar:/[...]/ui.jar:/[...]/BDJ.jar

- run ant, have fun.

O.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Bill Foote

bd-j-dev@mobileandembedded.org wrote:
> - download and install Java SE 6 Developer Preview 9
> (from http://developer.apple.com/java/download/)
>
> - link CurrentJDK to 1.6 in /System/Library/Frameworks/JavaVM.framework/Versions
>
> - adjust HDC_BDJ_PLATFORM_CLASSES in vars.properties:
> HDC_BDJ_PLATFORM_CLASSES=/[...]/classes.jar:/[...]/ui.jar:/[...]/BDJ.jar
>
> - run ant, have fun.

Thanks for posting this; I'm not sure if it was clear how easy
it is to build BD-J stuff on Mac now.

By the way, you've just described my configuration here in the
office. I do most of my building on OS/X; my big expensive PC
is mostly for running software players and for burning BD-RE discs.

This was made possible by a jarsigner putback a couple of weeks
ago by Jaya. Now our jarsigner doesn't need to override any system
classes, so it doesn't depend on some of the internal directory
structure specifics of the Windows JDK.

Because JDK 1.6 isn't universally available for Mac yet, we're
still keeping it so that JDK 1.5 will work for the "GrinView"
program. I enforce this by keeping my default JDK set to 1.5,
and only switching to JDK 1.6 when doing an xlet build.

Since I switch back and forth, I'm not actually linking CurrentJDK...
I just source this file:

billf@~/java.net/hdcookbook$ cat ~/bin/jdk1.6
export PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/:$PATH
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

Also, I put the platform definition in one zip file, and I point my
build directory to the mount point of my PC, so my user.vars.properties
looks like this:

billf@~/java.net/hdcookbook$ cat user.vars.properties
HDC_BDJ_PLATFORM_CLASSES=/Users/billf/bd-j/references/interactive/classes.zip
HDC_DISC_BDMV=/Volumes/shared/BookDiscBD/BDMV

Oh - and for other Mac folks out there, I can report that OS/X
has been very stable as of version 10.5.2. Before this version,
I had random crashes maybe once or twice a week -- it looked like
a deadlock in the graphics subsystem. That's cured as of 10.5.2;
it's been rock-solid since that update.

Cheers,

Bill
--
Bill Foote bill.foote @ sun.com
Blu-ray Java and Authoring Architect Sun Microsystems, L.A.

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

oliverlietz
Offline
Joined: 2007-09-30
Points: 0

> bd-j-dev@mobileandembedded.org wrote:
[...]
> Also, I put the platform definition in one zip file,
> and I point my
> build directory to the mount point of my PC, so my
> user.vars.properties
> looks like this:
>
> billf@~/java.net/hdcookbook$ cat
> user.vars.properties
>
> DC_BDJ_PLATFORM_CLASSES=/Users/billf/bd-j/references/interactive/classes.zip
> HDC_DISC_BDMV=/Volumes/shared/BookDiscBD/BDMV
[...]

Bill,

can you tell me what exactly is in your classes.zip? I didn't find it in the book nor anywhere else.

thx,
O.

billf
Offline
Joined: 2004-02-13
Points: 0

> Bill,
>
> can you tell me what exactly is in your classes.zip?
> I didn't find it in the book nor anywhere else.

Yes, my classes.zip contains the .class files that make up the platform
definition. It has Java .class files for java.*, javax.tv.*, org.bluray.*,
org.dvb.* and such.

We're working on making available what's needed to create this zip file, and also
making available the HTML "javadocs" of the platform definition. That process has
been caught up in the BDA for an inordinate length of time, but we're hopeful for a
good result soon.

In the meantime, for compiling you should be able to find a .zip or .jar files that
contains the necessary class definitions, perhaps by looking in one of the subdirectories
of one of the PC players. If you do that, it's possible you'll get a slight subset of the
API, so you need to be careful that you don't try to reference classes or methods
that aren't guaranteed to be present by the specifications.

There might be other sources of a classes.zip floating around as well.

I'm hopeful that this whole ridiculous situation will be wrapped up soon.

Cheers,

Bill

oliverlietz
Offline
Joined: 2007-09-30
Points: 0

> > Bill,
> >
> > can you tell me what exactly is in your
> classes.zip?
> > I didn't find it in the book nor anywhere else.
>
> Yes, my classes.zip contains the .class files that
> make up the platform
> definition. It has Java .class files for java.*,
> javax.tv.*, org.bluray.*,
> org.dvb.* and such.

Am I right in thinking that "the platform definition" consists of the packages below
(from a software player) and the classes found in PBP 1.0 (took the btclasses.zip
from Sun's PBP 1.1 RI)?

[i]javax.media.*
javax.tv.*
org.bluray.*
org.davic.*
org.dvb.*
org.havi.*[/i]

I tried to run ant from the root and it didn't work because of missing classes from java.awt.
It only works when configured as described in my first post. Maybe the build files for ant
should be improved to allow an out-of-the-box build for all parts of hdcookbook (btw, I found
other build errors). I got my first successful build after mavenizing hdcookbook and came
back to ant after seeing that it is actually buildable.

> We're working on making available what's needed to
> create this zip file, and also
> making available the HTML "javadocs" of the platform
> definition. That process has
> been caught up in the BDA for an inordinate length of
> time, but we're hopeful for a
> good result soon.
>
> In the meantime, for compiling you should be able to
> find a .zip or .jar files that
> contains the necessary class definitions, perhaps by
> looking in one of the subdirectories
> of one of the PC players. If you do that, it's
> possible you'll get a slight subset of the
> API, so you need to be careful that you don't try to
> reference classes or methods
> that aren't guaranteed to be present by the
> specifications.
>
> There might be other sources of a classes.zip
> floating around as well.
>
> I'm hopeful that this whole ridiculous situation will
> be wrapped up soon.

That would be really nice... thanks, Bill.

O.

chihiro_saito
Offline
Joined: 2006-11-08
Points: 0

> Maybe the build files for ant
should be improved to allow an out-of-the-box build for all parts of hdcookbook (btw, I found
other build errors). I got my first successful build after mavenizing hdcookbook and came
back to ant after seeing that it is actually buildable.

We'd like to do that as soon as the complete BD-J stub classes can be available to public!

Meanwhile, right now, the ant build should work out of the box as long as you adjust variables in trunk/vars.properties, specifically HDC_DISC_BDMV and HDC_BDJ_PLATFORM_CLASSES. The file dist.xml and unbundle.sh are really for those who are not pulling our sources from the repository.

BTW how did mavenizing go? I've never used Maven but wonder if it's a good option to make build script simpler to understand.

Chihiro

oliverlietz
Offline
Joined: 2007-09-30
Points: 0

> > Maybe the build files for ant
> should be improved to allow an out-of-the-box build
> for all parts of hdcookbook (btw, I found
> other build errors). I got my first successful build
> after mavenizing hdcookbook and came
> back to ant after seeing that it is actually
> buildable.
>
> We'd like to do that as soon as the complete BD-J
> stub classes can be available to public!
>
> Meanwhile, right now, the ant build should work out
> of the box as long as you adjust variables in
> trunk/vars.properties, specifically HDC_DISC_BDMV and
> HDC_BDJ_PLATFORM_CLASSES. The file dist.xml and
> unbundle.sh are really for those who are not pulling
> our sources from the repository.

Doesn't at least work for me on Mac OS...

[b]with BDJ.jar only:[/b]
[i][...]
build-menu-assets:
[move] Moving 1 file to /Volumes/bluray/hdcookbook/repo/trunk/dist/BDMV/AUXDATA
[move] Moving 1 file to /Volumes/bluray/hdcookbook/repo/trunk/dist/BDMV/AUXDATA
[move] Moving 1 file to /Volumes/bluray/hdcookbook/repo/trunk/dist/BDMV/AUXDATA
[jar] Building jar: /Volumes/bluray/hdcookbook/repo/trunk/dist/BDMV/JAR/00004.jar

build-menu-xlet:
[xlets.javac] Compiling 1 source file to /Volumes/bluray/hdcookbook/repo/trunk/grin/build/xlets/menuxlet/classes
[xlets.javac] Fatal Error: Unable to find package java.lang in classpath or bootclasspath

BUILD FAILED
/Volumes/bluray/hdcookbook/repo/trunk/build.xml:13: The following error occurred while executing this line:
/Volumes/bluray/hdcookbook/repo/trunk/grin/buildscripts/ant/build_hdcookbook_xlets.xml:64: Compile failed; see the compiler error output for details.
[/i]

[b]with btclasses.zip and BDJ.jar:[/b]
[i][...]
init-grin-me-library:
[mkdir] Created dir: /Volumes/bluray/hdcookbook/repo/trunk/grin/build/library

compile-me-library:
[xlets.javac] Compiling 54 source files to /Volumes/bluray/hdcookbook/repo/trunk/grin/build/library
[xlets.javac] /Volumes/bluray/hdcookbook/repo/trunk/grin/library/src/com/hdcookbook/grin/Show.java:70: package java.awt does not exist
[xlets.javac] import java.awt.Component;
[xlets.javac] ^
[xlets.javac] /Volumes/bluray/hdcookbook/repo/trunk/grin/library/src/com/hdcookbook/grin/Show.java:71: package java.awt does not exist
[xlets.javac] import java.awt.Cursor;
[xlets.javac] ^
[xlets.javac] /Volumes/bluray/hdcookbook/repo/trunk/grin/library/src/com/hdcookbook/grin/Show.java:72: package java.awt does not exist
[xlets.javac] import java.awt.Graphics2D;
[xlets.javac] ^
[xlets.javac] /Volumes/bluray/hdcookbook/repo/trunk/grin/library/src/com/hdcookbook/grin/animator/AnimationClient.java:59: package java.awt does not exist
[xlets.javac] import java.awt.Graphics2D;
[xlets.javac] ^
[xlets.javac] /Volumes/bluray/hdcookbook/repo/trunk/grin/library/src/com/hdcookbook/grin/animator/AnimationClient.java:60: package java.awt does not exist
[xlets.javac] import java.awt.Component;
[xlets.javac] ^
[xlets.javac] /Volumes/bluray/hdcookbook/repo/trunk/grin/library/src/com/hdcookbook/grin/Show.java:97: cannot find symbol
[xlets.javac] symbol : class Component
[xlets.javac] location: class com.hdcookbook.grin.Show
[xlets.javac] public Component component;
[xlets.javac] ^
[...]
[xlets.javac] /Volumes/bluray/hdcookbook/repo/trunk/grin/library/src/com/hdcookbook/grin/animator/RepaintDrawEngine.java:97: cannot find symbol
[xlets.javac] symbol : class Graphics2D
[xlets.javac] location: class com.hdcookbook.grin.animator.RepaintDrawEngine
[xlets.javac] private Graphics2D bufferG = null;
[xlets.javac] ^
[xlets.javac] 100 errors

BUILD FAILED
/Volumes/bluray/hdcookbook/repo/trunk/build.xml:13: The following error occurred while executing this line:
/Volumes/bluray/hdcookbook/repo/trunk/grin/buildscripts/ant/build_library.xml:43: Compile failed; see the compiler error output for details.[/i]

Therefore is asked what is excatly in Bill's classes.zip.
It works for me only with the setup described above
(with BDJ.jar, classes.jar and ui.jar).

> BTW how did mavenizing go? I've never used Maven but
> wonder if it's a good option to make build script
> simpler to understand.

first steps: flatten the directory structure, use Maven's standard directory layout
(http://maven.apache.org/guides/introduction/introduction-to-the-standard...),
create pom files and resolve dependencies. Lots of Maven's stuff is standardized
and "by convention" which makes it easy to understand a project. Give it a try.

O.

chihiro_saito
Offline
Joined: 2006-11-08
Points: 0

Hi Oliver,

> Doesn't at least work for me on Mac OS...

OK. The error you have here is about HDC_BDJ_PLATFORM_CLASSES variable in vars.properties not including all the BD-J platform classes. Until we can include bd-j classes in our repository, the most we can do is to document the variable better, I believe.

> first steps: flatten the directory structure, use Maven's standard directory layout
(http://maven.apache.org/guides/introduction/introduction-to-the-standard...),
create pom files and resolve dependencies. Lots of Maven's stuff is standardized
and "by convention" which makes it easy to understand a project. Give it a try.

Thanks. On a quick glance, this does seem to be a significant restructuring of the workspace, but I'll try a few things out.

Best,
Chihiro

monsta
Offline
Joined: 2004-11-24
Points: 0

Hi Oliver,

I was looking at that Java Preview and I thought it was just for 64bit Mac intel boxes ? Do you know if it works on 32bit as well ??

Also I too am looking into developing some blu ray apps on the Mac. Do you know where you get the classes.zip and BDJ.jar from ?? And are they specific for the Mac ??

Thanks,
Phil.

oliverlietz
Offline
Joined: 2007-09-30
Points: 0

> Hi Oliver,
>
> I was looking at that Java Preview and I thought it
> was just for 64bit Mac intel boxes ? Do you know if
> it works on 32bit as well ??

You are right, it is only for 64-bit Intel - I forgot to mention, sorry.

Landon Fuller is porting the FreeBSD JDK to Mac OS.
You can find SoyLatte (i386 and amd64) here: http://landonf.bikemonkey.org/static/soylatte/
I haven't played with it but it looks promising.

> Also I too am looking into developing some blu ray
> apps on the Mac. Do you know where you get the
> classes.zip and BDJ.jar from ?? And are they specific
> for the Mac ??

The classes.jar and ui.jar (contains AWT classes) are from Apples Java 6 and work so far.
If you are looking for btclasses.zip you can find it in Sun's reference implementations of
PBP 1.0 and 1.1 (http://java.sun.com/products/personalbasis/) or in one of those Windows
software players. BDJ.jar is from one of those Windows software players.
Maybe my version of Adobe Encore CS 3 comes with one too, but I can't say - thanks Adobe*.

> Thanks,
> Phil.

hth,
O.

* http://www.wemakepretty.com/2007/04/24/if-adobe-were-a-man-i-would-punch...

monsta
Offline
Joined: 2004-11-24
Points: 0

Thats great. Thanks for all that info Oliver.