Click here to Skip to main content
15,114,127 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I was trying to execute a simple program in IntelliJ IDEA as a static web project. I'm a newbie and I'm learning web development with Node.js. I took help from the official website of IntelliJ IDEA, but the error was same. Though, I configured the settings and Project structure also.

Error:

C#
"C:\Program Files\Java\jdk1.8.0_91\bin\java" -Didea.launcher.port=7535 "-Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 2016.1.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2016.1.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain ""

Exception in thread "main" java.lang.ClassNotFoundException: 
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)

Process finished with exit code 1


Please help me to sort out this problem. I'm digging out this problem since few days.
Posted
Updated 17-Jul-17 18:37pm
v2
Comments
Richard MacCutchan 25-Jun-16 3:25am
   
Something is going wrong in AppMain.java at line 122.
wardakhan 25-Jun-16 14:15pm
   
Javascript file...
Richard MacCutchan 26-Jun-16 2:44am
   
Is that supposed to mean something?
phil.o 25-Jun-16 6:13am
   
More specifically, at line 122 in AppMain.java file, you are trying to use a class of which your project cannot retrieve the definition.
We would need to see this line for further analysis.
wardakhan 25-Jun-16 14:16pm
   
When i execute the program, it says module not specified.

1 solution

The error you are receiving here means when you are trying to run the class, IntelliJ is not able to find it.

To fix this, you need to add a .jar file to the classpath:

java org.somepackage.SomeClass -cp myJarWithSomeClass.jar

or if running on the command line you must add the dot operator: (.)

java YourSingleClass -cp .

Hope this helped!
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900