46 thoughts on “How To fix could not find or load main class problem in java

  1. Failed to load a library. Possible solutions:
    a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
    b) Add the JAR that contains the shared library to the classpath.

  2. Hi!!!
    Thank you for your video.. It did work for me..

    I would like to add more into it..
    Rather than setting classpath every time on CMD its good practice to set path permanently into Environmental Variables.

    Please follow these steps..

    1.Go to "my computer" properties
    2.Click on "Advanced system settings"
    3.Click on "Environment variables"
    4.Click on new tab of user variable
    5.write classpath in variable name
    6.copy the path of bin folder ie.[C:Program FilesJavajre1.8.0_25librt.jar]
    7.paste path of bin folder in variable name
    8.click OK button

    Done!!!!! permanent path is set now.

  3. In your IDE, right click on the file that contains the main method, then rename it.
    It will compile.
    You can rename it back to its original name if you want to.

  4. can some one help me im so disppointed i will complete my task as per shedule but i cant cz my netbeans ide 8.2 not opening only show blue screen for some second after its gone and not open what should i will do pls if sir help me or any one can help me so im so thanks full ….!!

Leave a Reply

Your email address will not be published. Required fields are marked *