Results 1 to 6 of 6
- 05-27-2012, 10:56 PM #1
Member
- Join Date
- May 2012
- Location
- Germany
- Posts
- 3
- Rep Power
- 0
Error: Could not find or load main class
Hey guys,
every time I try to run my class I get an Error: Could not find or load main class
No explanation... I've never had such a problem.
What can be the mistake?
Here's my source code:
Java Code:public class FunctionalMotifEnergyParser { static String[] filenames = new File("C:\\Arbeitsordner\\Praxismodul\\Data\\XMLs\\").list(); public static void main(String[] args) { ArrayList<FunctionalMotifFragment> functionalFragments = FunctionalMotifFragmentLoader.loadFragments(filenames); System.out.println(functionalFragments.size()); for (FunctionalMotifFragment f : functionalFragments) { System.out.println(f.getSequence()); } } }
- 05-27-2012, 11:16 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,546
- Rep Power
- 11
Re: Error: Could not find or load main class
What command are you using to run the program? Note that the java executable must be able to find your class.
- 05-28-2012, 02:40 AM #3
Member
- Join Date
- May 2012
- Location
- Germany
- Posts
- 3
- Rep Power
- 0
Re: Error: Could not find or load main class
I use the Eclipse IDE and to run the programm I just press strg+F11.
- 05-28-2012, 03:42 AM #4
Re: Error: Could not find or load main class
That makes it an Eclipse question.
Moved from New to Java.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-28-2012, 10:48 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,466
- Rep Power
- 16
Re: Error: Could not find or load main class
Does Eclipse know which file is your main class?
Because you are just asking Eclipse to run whatever was run last with CTRL-F11.
Try right clicking on the class you want to run as the main class and select Run As... Java Application.Please do not ask for code as refusal often offends.
- 05-28-2012, 11:22 AM #6
Member
- Join Date
- May 2012
- Location
- Germany
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Error: Could not find or load the main class build.jar
By Stoyicker in forum New To JavaReplies: 2Last Post: 05-24-2012, 09:58 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


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks