I have the following code in netbeans (using javafx in the same project):
public class ExperimentControler {
public static HashMap<String,Double> userInput = null;
public static ObservableMapWrapper<String,Double> userInputObservable = null;
}
and
static final String totalDistance = "Total distance";
public static void main(String[] args) {
ExperimentControler.userInput = new HashMap<String,Double>();
ExperimentControler.userInput.put(totalDistance, 300.0);
ExperimentControler.userInputObservable = new ObservableMapWrapper<String,Double>(ExperimentControler.userInput);
Application.launch(PhysicsGui.class, args);
}
@Override
public void start(Stage primaryStage) {
ExperimentControler.userInput.get(totalDistance);
//...
}
This is working perfectly inside netbeans.
If I "clean and build" the project, the resulted .jar file throws a null pointer exception on this line:
ExperimentControler.userInput.get(totalDistance);
Also, this is my java version outside of netbeans:
>java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
I also tried with jre 1.7.0 but the results were exactly the same..
In netbeans I have jdk 1.6.0_26.