Think of -Import=foo as a way of setting the "Import" configuration option to value "foo".
Just drop the if statement:
public static void main(String[] args) {
String fileIn;
fileIn = System.getProperty ("Import");
System.out.println("Import "+fileIn);
}
BTW I think Sun chose -D (as opposed to - something else) because lots of C compilers allow you to set a macro on the command line with -D - meaning it'd be a way of setting named "constants" on the command-line... which is similar to what it does in Java.
I'm not sure why you'd get null running this, so here's a transcript of me compiling it and running it - with output. You're going to have to look at the differences between what you're doing and what I'm doing in this transcript:
Script started on Sat Nov 7 18:16:25 2009
bash-3.2$ cat T.java
public class T {
public static void main(String[] args) {
String fileIn;
fileIn = System.getProperty ("Import");
System.out.println("Import "+fileIn);
}
}
bash-3.2$ javac T.java
bash-3.2$ java -DImport=data.txt -Din=input.dat -Dout=output1.dat T
Import data.txt
bash-3.2$ exit
exit
Script done on Sat Nov 7 18:17:07 2009