Results 1 to 2 of 2
Thread: Could not find the main class
- 10-13-2011, 10:21 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 2
- Rep Power
- 0
Could not find the main class
Hey guys...new to Java so sorry if this is a stupid question.
OS: Windows 7
Code:
Java Code:class Ex1 { public static void main ( String [] args ) { // Set n to be user defined input int n = Integer.parseInt(args[0]); // Loop through n and print required sequence for (int i = 0; i < n; i++) { System.out.print(i+1); // n System.out.print((i+1)^2); // n^2 System.out.print((i+1)^3); // n^3 } } }
javac ex1.java
which creates the class in the same folder as ex1.java, then:
java -cp . ex1_1 4
but I get the error: "Could not find or load main class"
Any ideas? Thx for any help :)Last edited by RudeOil; 10-13-2011 at 10:36 PM.
- 10-13-2011, 10:37 PM #2
Member
- Join Date
- Oct 2011
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Could not find or load main class BubbleSort.class
By blaqkout in forum New To JavaReplies: 5Last Post: 09-12-2011, 08:54 PM -
Could not find main class
By Karenthian in forum New To JavaReplies: 7Last Post: 03-30-2011, 04:02 PM -
Could Not Find Main Class (AGAIN!)
By illjavathat in forum New To JavaReplies: 54Last Post: 10-22-2010, 04:22 AM -
Could not find main class
By Andyj in forum New To JavaReplies: 2Last Post: 10-06-2009, 01:47 AM -
Could not find main class - JDK 1.6
By Syranno in forum New To JavaReplies: 1Last Post: 07-25-2008, 05:07 PM
Bookmarks