kijiproject/kiji-schema — pull request #12 by kimballa (2012-12-03 23:41:54+00:00)
Title: SCHEMA-43. bin-script cannot be directly symlinked.

Resolve symlinks in "$0" argument recursively to establish
the canonical absolute path to the 'bin/kiji' script.

Tested with:

aaron@topsail:~$ ln -s src/kiji/kiji-schema/target/kiji-schema-1.0.0-rc2-SNAPSHOT-release/kiji-schema-1.0.0-rc2-SNAPSHOT/bin/kiji kiji

Before:

aaron@topsail:~$ ./kiji ls
ls: cannot access /home/aaron/..//lib/*.jar: No such file or directory
Exception in thread "main" java.lang.NoClassDefFoundError: org/kiji/schema/tools/LsTool
Caused by: java.lang.ClassNotFoundException: org.kiji.schema.tools.LsTool
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.kiji.schema.tools.LsTool. Program will exit.

After:

aaron@topsail:~$ ./kiji ls
12/12/03 15:38:51 WARN org.apache.hadoop.conf.Configuration: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
Listing tables in kiji instance: kiji://localhost:2181/default/
foo
bar
phonebook