This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot compile

 
Suka Hati
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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\String_Reader.java:535: 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
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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!
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic