Skip to content

Common Build Problems

meelash edited this page Dec 30, 2010 · 11 revisions
  • “Exception in thread “main” java.lang.NullPointerException"
    • You may be running OpenJDK instead of Sun’s Java JDK (confirm by running “java -version”). OpenJDK includes an incompatible version of Rhino. Remove it, or switch to the official Sun version of Java.
    • You may have another version of Rhino (“js.jar”) installed somewhere (possibly in /Library/Java/Extensions/ or ~/Library/Java/Extensions/ on OS X). Run the following in the Rhino shell (“java org.mozilla.javascript.tools.debugger.Main”) to find out where:
      org.mozilla.javascript.Context.getCurrentContext()["class"]. getClassLoader().getResource("org/mozilla/javascript/Context.class")
  • “/usr/bin/env: narwhal: No such file or directory”
    • You may be running gcj Java instead of Sun’s Java JDK (confirm by running “java -version”. gjc does not support reading of environment variables, which is required for the Cappuccino build process.
  • “SyntaxError: * Could not find definition for class "CPCib""
    • Remove any previously installed versions of the “objective-j” and “cappuccino” packages in Narwhal’s “packages” directory.
  • “InternalError: Encountered code generation error while compiling function “null”: generated bytecode for method exceeds 64K limit."
    • Set the “NARWHAL_OPTIMIZATION” environment variables to “-1” to disable Rhino optimizations (or reduce size of offending file)
  • “cc1obj: error: /var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Caches-/com.apple.Xcode.0/SharedPrecompiledHeaders/NativeHost_Prefix-ceqtmfabknwynzftyznkcgpuzhhf/NativeHost_Prefix.pch: No such file or directory
    cc1obj: error: one or more PCH files were found, but they were invalid
    cc1obj: error: use -Winvalid-pch for more information”
    • Trash the folder SharedPrecompiledHeaders/ (or just the NativeHost files in it?) and rebuild.