# hdcookbook - initialize problems

3 replies [Last post]
paulemasters
Offline
Joined: 2011-12-07
Points: 0

Hello:

Thanks to Bill for his patient help with getting the classes setup and the hdcookbook data loaded on my PC.

I have copied the data to a different folder than the SVN imported one. I have created a user.vars.properties with my bdj.classes and cookbook.dir and I have placed it in the folders I have run 'ant' in. As the demos are independent projects, I run 'ant' from E:\hdcookbooka\xlets\demos\big_shoe\01 and received:
BUILD FAILED
E:\hdcookbooka\xlets\demos\big_shoe\01\build.xml:22: Cannot find E:\invalid\path\java.net\hdcookbook\xlets\GrinXlet\generic_build.xml imported from E:\hdcookbooka\xlets\demos\big_shoe\01\build.xml

I looked at the build.xml but could not find the reference. I did a search of all the files in the base folder and subfolders and did not find \invalid. Thinking that I need to run 'ant' from the base folder as most folders appear to have a build.xml: Run 'ant' from E:\hdcookbooka:
BUILD FAILED
E:\hdcookbooka\build.xml:11: The following error occurred while executing this line:
E:\hdcookbooka\xlets\hdcookbook_discimage\build.xml:255: The following error occurred while executing this line:
E:\hdcookbooka\xlets\hdcookbook_discimage\build_bdjo_security.xml:62: Java returned: 1

I have tried to track this down, but the paths do not match those I have and I am not sure what to change them to or what else I need to do.

Wondering if that build got far enough to allow the first one listed above to run, I tried it again and received the same error.

I am very new to all of this not having a Unix background. I am sure I am doing something wrong as I have no idea what I am doing.

Am I supposed to put user.vars.properties in every folder that has var.properties? There are over 60 of them. Am I supposed to run 'ant' in every folder that has a 'build' xml file?

Thanks for any help.

Paul Masters

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

Something's not adding up... Maybe a typo somewhere, or something in the wrong directory?

Here's the chain it follows: In, e.g. xlets/demos/big_shoe/01, the build.xml contains this:

<property file="../user.vars.properties"/>

<property file="../vars.properties"/>

Looking in xlets/demos/big_shoe/vars.properties, we see:

cookbook.dir=/invalid/path/java.net/hdcookbook

bdj.classes=/invalid/path/classes.zip

Those are the two variables that need to be overridden in xlets/demos/big_shoe/user.vars.properties. Sometimes when I create a new project I mis-name it "usr.vars.properties" out of muscle memory, or make a typo in one of the two variable names, or something like that. Maybe that's what's happening?

Cheers,

Bill

paulemasters
Offline
Joined: 2011-12-07
Points: 0

Hello:

I looked at those files and I can't see a problem. But then I may be too close to it. Attached is All.zip which contains 01.zip, big_shoe.zip and base.zip. They each contain the user.vars.properties and vars.properties files and the build.xml from those folders, except base doesn't have the xml.

Is there somewhere I could read on ant? This is very confusing.

Thanks for any help.

Paul Masters

PS: I made a copy of the 2 lines in the vars.properties in big_shoe, commented out one set and put the values from user.vars.properties (copy and paste) and ran 'ant' in 01. It seemed to work better for a while then received the following. Perhaps something else is not set up?

sign-xlet:
[jdktools.java] Exception in thread "main" java.lang.NoClassDefFoundError: sun/security/tools/JarSigner
[jdktools.java] at net.java.bd.tools.security.SecurityUtil.signJarFile(SecurityUtil.java:669)
[jdktools.java] at net.java.bd.tools.security.SecurityUtil.signJars(SecurityUtil.java:561)
[jdktools.java] at net.java.bd.tools.security.BDSigner.main(BDSigner.java:165)
[jdktools.java] Caused by: java.lang.ClassNotFoundException: sun.security.tools.JarSigner
[jdktools.java] at java.net.URLClassLoader$1.run(Unknown Source) [jdktools.java] at java.security.AccessController.doPrivileged(Native Method) [jdktools.java] at java.net.URLClassLoader.findClass(Unknown Source) [jdktools.java] at java.lang.ClassLoader.loadClass(Unknown Source) [jdktools.java] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[jdktools.java] ... 3 more

BUILD FAILED
E:\hdcookbooka\xlets\GrinXlet\generic_build.xml:465: Java returned: 1

(PPS: I clicked on attach and the screen flickered and went back to the original post. The reply wasn't there. This has happened before on other replys.)

paulemasters
Offline
Joined: 2011-12-07
Points: 0

Hello:

Staggering on...

(PC, Windows 7 Ultimate 64 bit)

classpath: .;C:\Program files\Java\jdk1.6.0_29\lib\tools.jar;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip

path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.6.0_29\bin\;C:\Programfiles\Java\jdk1.6.0_29\lib\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\NetBeans 7.0.1\java\ant\bin\

In Control Panel/JAVA/JAVA/Java runtime environment settings has C:\Program files\Java\jre6\bin\javaw.exe
(Even though this appears to be for runtime, I tried adding the JDK to the list but was not able to do so. Likely I don't know how.)

The first problem: Ant looking for tools.jar in C:\Program Files (x86)\Java\jre6\lib
Looked in this forum for tools.jar. Found a reference to JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16
Could not find reference to JAVA_HOME related to ant or cygwin.

Copied tools.jar from C:\Program Files\Java\jdk1.6.0_29\lib to C:\Program Files (x86)\Java\re6\lib
That error cleared.
(Tried ant all -lib (that path) but didn't fix the problem - seemed to make no differnce.
(Tried adding that path to HDC_BDJ_PLATFORM_CLASSES=E:/BDJClasses/enhanced/classes.zip in E:\hdcookbooka\user.vars.properties but caused an error)

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

Now ant all appeared to work.

The compiles appear to reference the jre6 libraries, but as that is the runtime, I gather that is correct?

SE is in the 64 bit Program Files folder, would that be a problem?
As ME went into it's own folder but does not show 64 bit on Control Panel/Programs and Features I can't tell if it is 64 or 32 bit.

I realize that copying the file and putting it in a folder where it doesn't belong is incorrect.

#### What is the correct way of referencing that file? That is, how do I tell ant / javac et all to look at the JDK instead of the run time?

Apparently ant all doesn't do all the projects - most were compiled, a few not. I didn't keep a list of which was which - sorry, should have.

Ran ant in big_shoe/01
It apparently worked. However, the following happened 2 times near the start.
BUILD FAILED
E:\hdcookbooka\xlets\GrinXlet\generic_build.xml:232: Java returned: -1073741819

Played with TMT3.
Ran ant again and the build appeared to work with no errors.

All worked OK with TMT3 except for those that wanted number key input. TMT3 apparently 'sees' the key (keyboard or on screen 'remote' but does not pass it along to the code. Also, the HDCookbook DiscImage complete caused TMT3 to abend some where near the end of the feature playback. I made a disc of the weather sample and one of Shoe 07 - they both ran OK on my Panasonic DMP BD80.

FWIW... Sometimes TMT3 gets 'lost' and the next run doesn't work. TMT3 has to be closed and reopened then all works OK until the next time. This may be a local artifact.

Thanks for any help with my very novice questions.

Paul Masters