newbie question: Error: Could not find or load main class Java Result: 1
Hello all,
I am trying to learn java and I have this error several times:
Error: Could not find or load main class chinese1.Chinese1
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)
As you can guess the project name is chinese1.
But the same problem happened in several other projects, it starts ok then I make a change in the code and I get this error.
Even If I delete or make comments on the new code it doesn't help!!
In the chinese1 project i even make a comment of all the code and still has this error!!
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package chinese1;
//import java.io.FileInputStream;
//import javazoom.jl.player.Player;
/**
*
* @author Tiksuv
*/
public class Chinese1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
// Chinese ChForm = new Chinese();
// ChForm.setVisible(true);
//
// try {
// FileInputStream file= new FileInputStream("C:\\ChineseWords\\tu3.mp3");
// Player playmp3= new Player(file);
// playmp3.play();
//
// } catch (Exception e){
//
// }
}
}
I don't get it.
I work with Netbeans 7.0.1
I want to understand what I am doing wrong in general because it happened at other projects and also specifically for this project that I am just starting and want to continue without starting it over.
Thanks in advance,
Daniel
Re: newbie question: Error: Could not find or load main class Java Result: 1
Sorry, I don't know how your IDE works.
Is there a .class file created when you compile your code?
Re: newbie question: Error: Could not find or load main class Java Result: 1
Not in this case.
When there are no problems the class file is created
What IDE you use/recommend to do a software with a GUI?
Re: newbie question: Error: Could not find or load main class Java Result: 1
I don't have an IDE. I use an enhanced editor.
Re: newbie question: Error: Could not find or load main class Java Result: 1
I recommend you to use Crimson editor but if NetBeans help you identify your errors then you can use that but Crimson editor has numbers so when you compile them, you can see where your going wrong by which line
Re: newbie question: Error: Could not find or load main class Java Result: 1
Is your file also called Chinese1
Re: newbie question: Error: Could not find or load main class Java Result: 1
Quote:
Originally Posted by
ideaman
Not in this case.
When there are no problems the class file is created
What IDE you use/recommend to do a software with a GUI?
IDE or editors is a different debate. Well, your project name is chinese1 and your IDE expects a class with the name Chinese1 as you might have been configured it so while creating new project. So, try making a class named Chinese1 and re-compile it.