Results 1 to 8 of 8
- 12-31-2011, 03:09 PM #1
Member
- Join Date
- Dec 2011
- Posts
- 5
- Rep Power
- 0
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
- 12-31-2011, 03:15 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Re: newbie question: Error: Could not find or load main class Java Result: 1
You have a class Chinese1 in a package chinese1 so the full name of the class is chinese1.Chinese1; and that's how you're supposed to run it:
Java Code:java chinese1.Chinese1
JosBuild a wall around Donald Trump; I'll pay for it.
- 12-31-2011, 05:08 PM #3
Member
- Join Date
- Dec 2011
- Posts
- 5
- Rep Power
- 0
Re: newbie question: Error: Could not find or load main class Java Result: 1
Hi,
I don't "run" anything, I just press the > button (or F6) in netbeans.
I've also opened the command prompt to run what you told me and I still get the same error.
Daniel
-
Re: newbie question: Error: Could not find or load main class Java Result: 1
What does F6 do? I thought F11 was clean and build in Netbeans?
- 12-31-2011, 05:20 PM #5
Member
- Join Date
- Dec 2011
- Posts
- 5
- Rep Power
- 0
Re: newbie question: Error: Could not find or load main class Java Result: 1
F11 is Build Main Project
F6 is Run Main Project
- 12-31-2011, 05:20 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 12-31-2011, 05:21 PM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 01-01-2012, 12:29 PM #8
Member
- Join Date
- Dec 2011
- Posts
- 5
- Rep Power
- 0
Re: newbie question: Error: Could not find or load main class Java Result: 1
Happy New Year!!
I am trying to run the Chinese1 class
What I did so far is this:
I've created a new project Chinese1
Netbeans created the Chinese1.java file I posted here
I also created another class for the GUI and opened it from the main without problems
I then started to do what i saw here: Play mp3 using java.mp4 - YouTube
to add mp3 playing abbility to the program
then I've got the error I posted, even though i remarked the new code it didn't help to get the code running again
The problem is that I get this kind of error on the simplest of programs sometimes
I am trying to learn java with my son and it is really annoying that small code changes in a small program gets me this error and nothing I do can fix it.
That is why also a general question because it is not the first time I get this error.
Is there another java development platform for Windows that can I use to develop software with GUI like Netbeans?
I've tryed Eclipse but the GUI development it is not "built in" like in Netbeans.
I want also to develop to Android, after I got better in java.
Similar Threads
-
Could not find or load main class: c:\java\HelloWorldApp
By Atticus in forum New To JavaReplies: 10Last Post: 02-02-2012, 08:26 PM -
Error: Could not find or load main class HelloWorldApp (HELP)
By couch_mango in forum New To JavaReplies: 29Last Post: 02-02-2012, 08:23 PM -
Please help! Cannot find or load main class error
By BenH in forum New To JavaReplies: 3Last Post: 12-09-2011, 03:51 AM -
Error: Could not find or load main class Ops.java
By Javasubbu in forum New To JavaReplies: 4Last Post: 10-05-2011, 10:52 PM -
Error: Could not find or load main class
By ITSlave in forum New To JavaReplies: 4Last Post: 09-15-2011, 09:47 AM
Bookmarks