dev-hacks

Collection of developer hacks and tricks by @ololobus

View the Project on GitHub

Java

Compile java sources

javac JavaClass.java

Run java class

java JavaClass
java -cp /path/to/java/classes/* JavaClass

Create a jar file

jar cf java_class-v1.0.jar JavaClass.class
jar cf java_class-v1.0.jar *.class

Viewing the contents of a jar file

jar tvf java_class-v1.0.jar

CLASSPATH example

export CLASSPATH=.:$HIVE_HOME/lib/*:$HIVE_HOME/jdbc/*:$HADOOP_HOME/lib/*:$HOME/local/*