Skip to main content

HDCookbook Grinview Examples

Please note these forums are being decommissioned and use the new and improved forums at
5 replies [Last post]
Joined: 2011-08-24

The HDCookbook Project is checked out from the repository to the laptop I am using.

After getting over the 'Map.Entry not found' issue, I am now able to compile
the HDCookbook Project pretty much from scratch. Some minor configuration changes
were made to be able to run the following in the trunk directory with no errors.

ant clean


Changes to the configuration include:

1) The file was updated to point the bdj.classes property to the stubs BD-J JAR in
the Java_ME_platform_SDK_3.0/runtimes/bd-j/ directory.

2) Becuase of a certificate/signing error at build time (and I only wanted to run/compile grinviews), some tasks were commented out as dependencies of
the 'build-xlets' task in xlets/hdcookbook-discimage/build.xml. The tasks that were commented are
'sign-xlets, generate-bdjo, generate-bdmv-files'

After getting a successful build from the trunk directory, I cd to
the 'xlets\grin_samples\HelloGrinWorld' directory and ran 'ant run_grinview'. This started
up a 'GRIN show viewer' window, and a second window that I guess was supposed to be the GrinView.

The second window is just a black rectangle. I used the GRIN show viewer to get a PNG sceen capture, but it too is blank. I attached screen shots.

I am using Windows 7, Cygwin, Java 7 on a 64 bit architecture. This machine is dual boot
with Ubuntu 11.10 and Java 7, as well. Running the grinview examples on Ubuntu gives the same blank

Can anybody see something about my config that is causing the Grinview to show only a black rectange for the HDCookbook grin_samples?

grinview-black-rectangle-details.png234.77 KB
grinview-black-rectangle.png7.94 KB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2011-12-07


I am no expert at any of this. Bill Foote is the expert. However, There have no posts from him, or nearly anyone else for that matter, for over 2 months.

We seem to have the same environment, W7 and cygwin. I also run 64 bit so some of the following will have ...Program Files (x86) - which is 32 bit and ...Program Files which is 64 bit. Also, my Java likely will be a different version than yours. It took me quite a while to get most of this working. I had to make a number of adjustments that are not documented anywhere that I could find. I will try and describe what I did. Hopefully it will help. I am not a JAVA or UNIX person. Please excuse if I tell you something you already know.

You appear to have gotten past my first problem. Running ant. I had to put C:\Program Files\NetBeans 7.0.1\java\ant\bin\ in the Windows path to get ant to run. (It was the only 'copy' of ant I could find.)

Next ant was looking for tools.jar so I copied tools.jar from C:\Program Files\Java\jdk1.6.0_29\lib to C:\Program Files (x86)\Java\re6\lib

There was still an error relating to the signing. I noticed this message in the cygwin log: dropping C:\Program Files (x86)\Java\lib\tools.jar from path as it doesn't exist. As it wanted that path, I created it and copied tools.jar from C:\Program Files\Java\jdk1.6.0_29\lib

I asked on the forum if the above was the correct way to do what I appeared to need. Unfortunately, I have not received a reply.

You likely have the 6 class files collected and setup according to the instructions (there are 2 sets depending on which WEB page you find). If you haven't I don't think your compiles would have gotten as far as you indicated. If you don't have the BD classes, you will get an error saying java.lang was not found.

You do need to get the signing to work. It may not be needed for GrinView but it will be needed if you try to play the compiled / created disc with a software player or burn a disc for a hardware player.

Also note that running ant from the base folder does not compile everything as is implied. Some is and some is not - mainly the demos. You will have to go to each demo folder and run ant and you may have to create or modify in that folder or one of the higher level ones. You may have noticed that this stuff is spread around quit a bit. (Each of the big shoe demos are like that. They each have their own folder, but use information from the main 'shoe' folder. I had errors running ant in the MHPMenu... demos. I haven't found out how to fix that.

That's all I can think of about the setup and initial compile. Perhaps you have already done all that.

GrinView appears to be a very rudimentary test tool. It doesn't have access to any of the BD classes, so you can't fully test a project like you can with some DVD authoring products. As best as I can figure out you click on the 'show' sections in the 'code' window and that section plays. I haven't found any way to use the mouse or anything else to actually step through a menu. Then again I may not have found the instructions.

there are at least two ways to run GrinView. One appears to be with a shell file from the cygwin console window. The other is much easier. Each demo or compiled 'project' should have a xxx-grinview.jar file in the base folder. For example go to big_shoe/01 and if that has been compiled there will be a Shoe-grinview.jar there. Click on it and you should see the Grin show viewer and the display window. Clicking on the 'segments' in the viewer will cause that 'code' to run and display in the view window. Of course for shoe 01, there isn't much. Not all folders have that. And some are very hard to find, at least for me. I was just looking for the cook book disc one and didn't find it. I know it's there as I remember running it at one time.

To setup your own project: This is not easy to find. There are some instructions in hdcookbook/xlets/GrinXlet/ - it appears to be fairly easy once you get the hang of it. I had a link to some 'show' documentation that is buried very deep in the folders somewhere. Unfortunately, I lost all that when my C drive died. Be sure to copy a show file from one of the demos. Hello Grin World or Shoe/01 are the simplest. The code in the book is missing some Java entries that are needed. (The 'show' documentation I mention has those entries in it, but they are buried in the middle somewhere.)

I hope some of this helps.

Paul Masters

Joined: 2011-08-24

Hi Paul. Thanks for the tip on how to get the Grinview going in the show viewer. I was clueless about having to double click a segment's 'next' node, to get it displayed. A screenshot is attached.

There is a Grinview that demos Grinview basics under xlets\tests\functional\Playground. It also demonstrates remote control input. I haven't seen anything for mouse input, yet.

I am glad the BD-J team put this tool together.


Joined: 2011-12-07


Glad my stumbling around was helpful. Thanks for the pointer. I missed that one. It is very interesting. It is good to see how someone else does things. Especially when it is the author.

Yes, Grin is a very useful and needed tool. It is a text version of a graphical interface like many of the expensive authoring products. But most importantly it provides many more features of BDJ than some of those products do. It appears to be all that's needed for 'normal' discs or even those with complex navigation. More specialized applications, such as games or WEB access will likely require additional manual Java coding.

GrinView while limited by it's nature is a very useful tool. It allows you to see what the screen will look like and how some of the animation will look with out having to create a complete disc.

Grin does have provision for mouse input. However, that may only work on a computer as most players don't have any of that type of input - although I don't know enough about all this to be sure.

One of my problems with this large amount of code is the way it is spread out. I am not Unix oriented and am use to everything being in one place. Also, finding any documentation on what to do is difficult and so far I have found little. There is a lot of JavaDoc but that just lists the Java class calls and doesn't explain what the fields are for or what you can do with them. Of course, with Grin, you don't need all that anyway.

I realize that a lot of the pieces and parts is due to how BD is designed. A lot of little files with many of them using different data formats. Bill and others did a good job in trying to make all this as easy as possible while still having greater flexibility.

Paul Masters

Joined: 2007-09-30
Joined: 2011-12-07


Thanks for the links. I have seen your prior post. I have intended to reply to that as I don't understand what it is or what to do with it. Is it an addition to or a replacement of some of the HDCookbook files? In my brief look at the first link, there appears to be another product? Or, is all that the product?

I am not literate in Unix or Java as you can tell if you happen to see my other posts, therefore, I need more help in understanding what to do than those that are.

Thanks for any help.

Paul Masters