Skip to main content

When running program java.lang.NullPointerException occurs, what causes this error? how to solve?

 When just running some program which downloaded from site or just click applications I got, sometimes we face an error window with 'java.lang.NullPointerException'.


This error window caused by 3 kinds of reason.

First, Application needs Configuration File to run with.

 Many Program has configuration file to run the application. Configuration file extensions are variable like '.ini', '.yaml', '.config', '.txt', etc... Somehow if you erase the configuration file or copied the application.exe to other folder without the configuration file. This could cause NullPointerException.

Second, Application Needs Parameter(s) to run.

 Some application needs parameter to run. When your program start or do something with UI, there could be selection to do. But without selection, your program could throw NullPointerException. So, you can check application guide what should you missed to check in checkbox or select files or other things in application.


Third, Application Internal Error.

 This is rare for published application these days. but when application updates, it could happen. Because small company doesn't have enough resource to test. So you can report the error to the company.


With these 3 check points, you can fix the error or at least find where to ask for the NullPointerException Error.

Comments