• Post Reply Bookmark Topic Watch Topic
  • New Topic

having issues replacing strings  RSS feed

 
Timy McTipperstan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So somewhere in my java code there is this


I get compile errors telling me that the replaceAll method is undefined for the type string.

not sure, runs fine if its in a jsp.
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What JDK are you using? Type java -version.
 
Timy McTipperstan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hummm seems to be 1.3.1 which would explain the issue.
Sorry I thought i upgraded that.
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Timy McTipperstan:
Hummm seems to be 1.3.1 which would explain the issue.
Sorry I thought i upgraded that.


That'd be your problem. Somehow Tomcat (or whatever servlet/JSP container you're using) is running using a 1.4+ JVM.
 
Timy McTipperstan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah I just updated to 1.4.2_08 and Eclipse still wont compile.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Timy McTipperstan:
Ah I just updated to 1.4.2_08 and Eclipse still wont compile.


Works for me... What errors are you getting?

Henry
 
Timy McTipperstan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method replaceAll(String, String) is undefined for the type String.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you tell Eclipse that you want to use the new JDK?
 
Timy McTipperstan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought so, however I am now doubting. where would I do that? since it didnt seem to work when I did it the last time.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Timy McTipperstan:
I thought so, however I am now doubting. where would I do that? since it didnt seem to work when I did it the last time.


Window --> Preferences --> Installed JREs --> ...

Henry
 
Timy McTipperstan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Henry Wong:


Window --> Preferences --> Installed JREs --> ...

Henry


Yeah thats what I had done. Twice.
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just installing the new JRE doesn't do the trick. You have to tell Eclipse to use it in your project.
 
Timy McTipperstan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something did the trick, I think it might have been restarting.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!