grifan526
03-03-2009, 09:08 PM
I am new to Java so I am sure this is an easy one for some of you. I am working a project that reads information from a file and then sorts it. It compiled but when I ran it I got this error:
java.lang.NoSuchMethodError: main
Exception in thread "main"
----jGRASP wedge2: exit code for process is 1
my main method is:
public void main(String[] args){
Vehicle[] List=new Vehicle[20];
Scanner ListInput=new Scanner(args[0]);
int i=0;
for(i=0;ListInput.hasNextLine();i++){
if(i==List.length){
Vehicle[] temp=new Vehicle[List.length*2];
for(int j=0;j<List.length;j++){
temp[j]=List[j];
}
List=temp;
}
There is more but it involves classes I wrote and I want to keep the code here short. If anyone can help me with this I would greatly appreciate it.
java.lang.NoSuchMethodError: main
Exception in thread "main"
----jGRASP wedge2: exit code for process is 1
my main method is:
public void main(String[] args){
Vehicle[] List=new Vehicle[20];
Scanner ListInput=new Scanner(args[0]);
int i=0;
for(i=0;ListInput.hasNextLine();i++){
if(i==List.length){
Vehicle[] temp=new Vehicle[List.length*2];
for(int j=0;j<List.length;j++){
temp[j]=List[j];
}
List=temp;
}
There is more but it involves classes I wrote and I want to keep the code here short. If anyone can help me with this I would greatly appreciate it.