¿IntelliJ IDEA error? I can not compile anything [Solved]
Hi, I have been surprised that I can IntelliJ IDEA compile anything, I always make some mistake, even the simplest example I can do I mark it as a bug, I honestly do not know why this is the error, I tried the following code:
import javax.swing.*;
public class Principal{
public static void main(String[] args){
JPanel panel1 = new JPanel();
JFrame aplicacion = new JFrame();
aplicacion.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
aplicacion.add(panel1);
aplicacion.setSize(230,230);
aplicacion.setVisible(true);
}
}
And I marked the following errors:
"C:\Program Files\Java\jdk1.6.0_26\bin\java" -Didea.launcher.port=7536 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 10.5\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.6.0_26\jre\lib\alt-rt.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\alt-string.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\ext\sunjce_provider.jar;C:\Users\Morringo\Documents\IntelliJ IDEA Projects\Example 1\out\test\Example 1;C:\Users\Morringo\Documents\IntelliJ IDEA Projects\Example 1\out\production\Example 1;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 10.5\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain MainClass
Exception in thread "main" java.lang.ClassNotFoundException: MainClass
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
Process finished with exit code 1
Using Windows 64-bit system and I think the example is pretty good. That kind of mistakes I started to make an overnight.
Thank's all.
Greetings.
请先登录再写评论。
Your example class is called Principal, you are trying to run a class called MainClass. I assume you compiled it ?
Ok, thank's for your answer.
The error of this example was the setting. But in another example, also I get error, be that previously had tried and not come out any errors.
Is a simple button that when the user clicked it, this button display a Dialog showing text: "button1 =)"
¿What's my error?
=== Added ===
I can't find the error, I have installed JDK 1.6 update 26 (64 bits) and configured in IntelliJ IDEA and I've make this basic example and the error appears too.
I only press Alt+Insert and select the option for the main method, the error for this last example is:
Please saying me, ¿what's my error?