Java method /Cannot resolve symbolerror

load.java:26: cannot resolve symbol
symbol  : method contains (java.lang.String)
location: class java.lang.String
if(line.contains("="))
        ^

how do i resolve this error
LVL 1
rahulsuryaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

el_diosCommented:
You are using java1.3 to run the code. Contains method was added in java 1.4 and is available onwards.

Sashwat
http://tech-sash.blogspot.com
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rahulsuryaAuthor Commented:
but my JAVA_HOME directs to jdk1.5
0
JaaxArchitectCommented:
In your command prompt type java -version and check the java version
0
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

rahulsuryaAuthor Commented:
it says java 1.4.2_05
0
el_diosCommented:
Using any IDE or using command prompt?
0
JaaxArchitectCommented:
contains has been included since java 5.
So that is the cause of ur problem. Upgrade to 1.5 or we gotta find a work-around
0
rahulsuryaAuthor Commented:
i'm using shell on unix.

My application/programs run on unix server
0
rahulsuryaAuthor Commented:
i don have enough permissions to update/ but i have jdk1.5.04 installed on the server
0
JaaxArchitectCommented:
Use indexOf instead
(line.indexOf("=") > -1)
0
rahulsuryaAuthor Commented:
i used complete path to javac in jdk1.5 and compiled and it worked
0
Mayank SAssociate Director - Product EngineeringCommented:
indexOf () is reliable across versions
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.