File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes cannot compile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "cannot compile" Watch "cannot compile" New topic

cannot compile

Suka Hati
Ranch Hand

Joined: Oct 28, 2004
Posts: 56
hi there....
im now developing java application....but yesterday i'm using a new pc....when i tried to run the application that i've write at my previous pc....i got this error(one of it)....

C:\pause\Source\ cannot resolve symbol
symbol : method replaceAll (java.lang.String,java.lang.String)
location: class java.lang.String
str = str.replaceAll("sy","S");

t think it might becouse of the path and classpath setting......

in path setting.....i put...jsdk_directory\bin

where...for classpath...i put....jsdk_directory\lib;directory_of_jar_files

is there something mising in my setting....

can somebody help me!!!
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199


The replaceAll() method in the String class was introduced in JDK 1.4. The error message is saying there's no such method, so the computer you're using must have JDK 1.3 or earlier installed. Time for an upgrade!

[Jess in Action][AskingGoodQuestions]
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2398
Your CLASSPATH wouldn't have anything to do with it. Probably your using a version of Java that didn't have the method replaceAll in String
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Check your JAVA_HOME, see if its pointing to an old version of Java (1.3 & below). And lastly, as previously suggested, grab JDK 1.4 or higher

Have lotsa fun with Java!

SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
I agree. Here's the link:
subject: cannot compile
It's not a secret anymore!