• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

having issues replacing strings

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah I just updated to 1.4.2_08 and Eclipse still wont compile.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The method replaceAll(String, String) is undefined for the type String.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Something did the trick, I think it might have been restarting.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i got the same issue and resolved when i changed order of jre version . for eg i m using jre 8 then order should in java build path first ie order and export
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

I am not quite sure I understand your question, but, as a general rule of thumb, put the most recently installed Java® version first in the PATH environment variable, and remove any other Java® PATHs. Most people do that by upgrading the single JAVA_HOME environment variable. Many poeple also uninstall older Java® versions on spec, but it is sometmes useful to be able to run those older versions.
 
reply
    Bookmark Topic Watch Topic
  • New Topic