Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6248691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:06:18+00:00 2026-05-24T13:06:18+00:00

I have the following code in netbeans (using javafx in the same project): public

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:06:19+00:00Added an answer on May 24, 2026 at 1:06 pm

    OK… thanks to Kal’s comment:

    How are you running this program? Have you tried putting
    System.out.printlns() in your main method to make sure that they are
    called before the app crashes with a NPE?

    I figured out that the following (javafx) code (must be this.. there is no other entry point):

    @Override
    public void start(Stage primaryStage) {
    

    bypasses the main() when I run it as standalone. Maybe the root cause is totally different I don’t know..
    The fact is that in netbeans, main() is running and on the standalone is not..
    I also checked the jar’s manifest and the main-class is correct. (just in case)

    My mind could not go to the fact that main is not running at all !
    So, I moved the code I had in main() to the overrided start method and it works.

    The specification says that the start() method is the main entry point for javafx applications.
    But, in my understanding, main() should still be called before start().. this could be a bug on javafx.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Spring MVC 3, NetBeans I have the following model, public class
I have following code: public static void ProcessStep(Action action) { //do something here if
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following code class User attr_accessor :name end u = User.new u.name =
I have following code snippet that i use to compile class at the run
I'm using NetBeans as my IDE. Whenever I have some code that uses another
I have class like following: public class Tree<T extends Comparable<? super T>> { //
I have following Code Block Which I tried to optimize in the Optimized section
I have following code in my application: // to set tip - photo in
I have following code in my Application. Comments in my code will specify My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.