• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile error

 
Jacob Michaels
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't seem to figure out why this code won't compile. I keep getting this error message:
Sort.java:22: cannot resolve symbol
symbol : method sort (java.lang.String[])
location: class Arrays
Arrays.sort(s);
^
1 error
I have j2sdk 1.4.1.02 installed
Thank you for any responses.

import java.util.*;
public class Sort
{
public static void main(String argv[])
{
Sort s = new Sort();
}
Sort()
{
String s[] = new String[4];
s[0]="z";
s[1]="b";
s[2]="c";
s[3]="a";
Arrays.sort(s);
for(int i=0;i< s.length;i++)
System.out.println(s[i]);
}
}
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jacob,
Gee dude, it compiles and runs fine on my machine. What OS are you using?
Michael Morris
 
Jacob Michaels
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using XP Home
I am also using TextPad editor.
Just for grins, I typed the command in the command prompt and it compiled and ran fine;
maybe I need to see if I have the lastest version of TextPad.
Thank you!!
[ March 29, 2003: Message edited by: Jacob Michaels ]
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jacob,
I use TextPad also. It's as close to an IDE as an old fart like me is going to get. You can check the command for compile Java with Configure->Preferences. When the dialog comes up, click the + on Tools and highlight Compile Java, you can fully qualify the compiler path, add command line parameters, etc.
Michael Morris
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic