0

I'm trying to run my java program in Mac terminal. This picture shows my contents in Netbeans, I wanna run "SeqList":

This picture shows my contents in Netbeans,I wanna run "SeqList"

First I code

javac SeqList.java

then it successfully create SeqList.class,whose classpath is /Users/andychao/Desktop/JAVVVVA/DataStractureTest/src/homework/SeqList.class

(my project name is "DataStractureTest",my package name is "homework")

But when I tried

java SeqList

or

java homework.SeqList

or even

java /Users/andychao/Desktop/JAVVVVA/DataStractureTest/src/homework/SeqList

I always received

Error: Could not find or load main class SeqList

I read other people's answers to this problem,but still cannot figure out it.

Is there anybody who can give me some specific advice? THX!

DimaSan
  • 12,264
  • 11
  • 65
  • 75
Andy Zhao
  • 13
  • 3
  • 1) Why can't you run this from NetBeans? 2) It's hard to help without knowing if there is even a main method in that class 3) Even if this worked, you likely need to add the other classes to the classpath when you compile – OneCricketeer Oct 19 '16 at 13:43
  • @cricket_007 (1)I can run it in NetBeans (2)it has a main method (3)I just wanna run this ".class" document,and there is only one java class in it – Andy Zhao Oct 19 '16 at 14:23
  • Seqlist doesn't extend or implement that other list class? – OneCricketeer Oct 19 '16 at 14:25
  • No,it just imports some packages. – Andy Zhao Oct 20 '16 at 13:41

0 Answers0