Skip to main content

A building question: Fatal Error: Unable to find package java.lang in class

8 replies [Last post]
nikkizeng
Offline
Joined: 2009-05-27

Hi,

I have successfully built the whole hdcookbook project and created a disc. I mean I ran "ant" in the hdcookbook root folder and then the disc was created. But I don't know why there is the fatal error when I try to build the hdcookbook/xlets/hdcookbook_discimage folder directly. Here is the error message:

build-menu-xlet:
[xlets.javac] Compiling 1 source file to /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes
[xlets.javac] Fatal Error: Unable to find package java.lang in classpath or bootclasspath

BUILD FAILED
/Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build.xml:125: Compile failed; see the compiler error output for details.

Actually it is the same error as I met before. Last time I didn't set the vars.properties in the root folder correctly, but I can't figure out what is wrong this time. Can anyone give me some suggestions? Thanks a lot!!!

Nikki

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
billf
Offline
Joined: 2004-02-13

I tried a couple of things, and I can't duplicate the problem...

Usually I recommend overriding the property values in a file called user.vars.properties in the
same directory as vars.properties. That way, a later update to vars.properties doesn't overrwrite your values when you do a bringover.

But, changing vars.properties should work to. Could you post the contents of your /vars.properties file,. from /Users/nikki/Documents/hdcookbook-simon/hdcookbook?

Also, could you run "ant -verbose", and paste in the part that shows the command it's running when it fails?

Thanks,

Bill

nikkizeng
Offline
Joined: 2009-05-27

Hi Bill,

Thank you very much for your help.

Here is the /vars.properties content:

#HDC_BDJ_PLATFORM_CLASSES=../../../classes.zip
HDC_BDJ_PLATFORM_CLASSES=../../../BDJ.jar
bdj.classes=${HDC_BDJ_PLATFORM_CLASSES}

Either HDC_BDJ_PLATFORM_CLASSES=../../../classes.zip or HDC_BDJ_PLATFORM_CLASSES=../../../BDJ.jar can work. But HDC_BDJ_PLATFORM_CLASSES=/../../../classes.zip:/../../../BDJ.jar has a problem - Could not find bd-j platform classes at /../../../classes.zip:/../../../BDJ.jar

The detailed info after I used -verbose is as follows:
[xlets.javac] com/hdcookbook/bookmenu/assets/menu.txt skipped - don't know how to handle it
[xlets.javac] com/hdcookbook/bookmenu/assets/mosaics.txt skipped - don't know how to handle it
[xlets.javac] com/hdcookbook/bookmenu/assets/sound.bdmv skipped - don't know how to handle it
[xlets.javac] com/hdcookbook/bookmenu/menu/AbstractDiscNavigator.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/AbstractDiscNavigator.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/BioUpdater.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/BioUpdater.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/BookmarkManager.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/BookmarkManager.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/MenuAssetFinder.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/MenuAssetFinder.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/MenuDirector.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/MenuDirector.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/MenuDiscNavigator.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/MenuDiscNavigator.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/MenuXlet.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/MenuXlet.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/UserInputManager.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/UserInputManager.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/bluray.MenuXlet.perm skipped - don't know how to handle it
[xlets.javac] com/hdcookbook/bookmenu/menu/test_assets/MenuScreenBG_gray.png skipped - don't know how to handle it
[xlets.javac] com/hdcookbook/bookmenu/package.html skipped - don't know how to handle it
[xlets.javac] license_header.txt skipped - don't know how to handle it
[xlets.javac] com/hdcookbook/bookmenu/menu/commands/MenuShowCommands.java added as com/hdcookbook/bookmenu/menu/commands/MenuShowCommands.class is outdated.
[xlets.javac] com/hdcookbook/bookmenu/menu/BioImageFeature.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/BioImageFeature.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/PlayVideoCommand.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/PlayVideoCommand.class is up to date.
[xlets.javac] com/hdcookbook/bookmenu/menu/PlayVideoExtension.java omitted as /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes/com/hdcookbook/bookmenu/menu/PlayVideoExtension.class is up to date.
[xlets.javac] Compiling 1 source file to /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes
[xlets.javac] Using modern compiler
[xlets.javac] Compilation arguments:
[xlets.javac] '-deprecation'
[xlets.javac] '-d'
[xlets.javac] '/Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes'
[xlets.javac] '-classpath'
[xlets.javac] '/Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menuxlet/classes:/Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/grin_library:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-jai.jar:/usr/share/ant/lib/ant-jmf.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant-nodeps.jar:/usr/share/ant/lib/ant-swing.jar:/usr/share/ant/lib/ant-testutil.jar:/usr/share/ant/lib/ant-trax.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/xercesImpl.jar:/usr/share/ant/lib/xml-apis.jar'
[xlets.javac] '-target'
[xlets.javac] '1.3'
[xlets.javac] '-bootclasspath'
[xlets.javac] '/Users/nikki/Documents/hdcookbook-simon/classes.zip'
[xlets.javac] '-g:lines,source'
[xlets.javac] '-source'
[xlets.javac] '1.3'
[xlets.javac]
[xlets.javac] The ' characters around the executable and arguments are
[xlets.javac] not part of the command.
[xlets.javac] File to be compiled:
[xlets.javac] /Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build/xlets/menu_generated/xlet/com/hdcookbook/bookmenu/menu/commands/MenuShowCommands.java
[xlets.javac] Fatal Error: Unable to find package java.lang in classpath or bootclasspath

BUILD FAILED
/Users/nikki/Documents/hdcookbook-simon/hdcookbook/xlets/hdcookbook_discimage/build.xml:125: Compile failed; see the compiler error output for details.
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:999)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:820)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Thanks,
Nikki

billf
Offline
Joined: 2004-02-13

I suggest using an absolute pathname in the user.vars.properties
file. To tell you the truth, I don't know what ant does with relative
pathnames when you include properties files and build files from other
directories up and down the hierarchy! So, just give
/users/nikki//classes.zip as the path.

Just to be sure, looking at the compile that fails, it's looking here:

[xlets.javac] '-bootclasspath'
[xlets.javac] '/Users/nikki/Documents/hdcookbook-simon/classes.zip'

I assume that's not where classes.zip actually lives?

Cheers,

Bill

Is that actually where classes.zip is locate?

nikkizeng
Offline
Joined: 2009-05-27

Hi Bill,

The classes.zip was actually located in /Users/nikki/Documents/hdcookbook-simon
But I just put the files into /Users/nikki/Documents/hdcookbook-simon/hdcookbook folder and now it works!!! So weird... Anyway, thanks a lot for your help!

Nikki

billf
Offline
Joined: 2004-02-13

The thing you want to do is use an absolute pathname in the user.vars.properties - one that starts with "/", not "..".

Cheers,

Bill

nikkizeng
Offline
Joined: 2009-05-27

Hi Bill,

I just tried the absolute pathname in vars.properties, but it didn't work. So I will keep the successful path I used. Actually I don't use user.vars.properties. Do I need it?

Thanks,
Nikki

billf
Offline
Joined: 2004-02-13

It's OK to just change vars.properties, but I'd recommend leaving vars.properties untouched, and instead making a new user.vars.properties file that overrides the settings in vars.properties.

The thing is, if you change vars.properties, and sometime later we make a change to that file, you'll get a conflict when you bring over the repository the next time. It wouldn't be a big deal to resolve it, but it's always nice to avoid source code management version conflicts.

Cheers,

Bill

nikkizeng
Offline
Joined: 2009-05-27

I see. Thanks for the clear explanations!

Regards,
Nikki