Tuesday, September 23, 2014

Java: Including jar files

To compile:

/software/java64/jdk1.7.0_60/bin/javac -cp ~/class -d ~/class -extdirs ~/jars ~/src/MyProgram.java

To execute:

/software/java64/jdk1.7.0_60/bin/java -Djava.ext.dirs=/privdir/xcnb804/jars -cp ~/class MyProgram

Where I got burned was this: while compiling you can use the tilde on the -d option, but while executing you cannot use the tilde on the java.ext.dirs system property.

Monday, September 15, 2014

Java: Get system property from the command line

java -Dmy.prop="my value" MyApp

public class Main {
  public static void main(String[] argv) throws Exception {
    String prop = System.getProperty("my.prop");

Tuesday, September 9, 2014

SAS: proc sql nowarnrecurs

If your PROC SQL overwrites one if its inputs then you will get a warning message.  You can eliminate that message by using the nowarnrecurs option.  For example:

proc sql noprint nowarnrecurs;
create table work.a as
select * from work.a;