Solved

Java method /Cannot resolve symbolerror

Posted on 2007-03-28
11
666 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:rahulsurya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 3

Accepted Solution

by:
el_dios earned 65 total points
ID: 18806537
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
 
LVL 1

Author Comment

by:rahulsurya
ID: 18806560
but my JAVA_HOME directs to jdk1.5
0
 
LVL 10

Assisted Solution

by:Jaax
Jaax earned 60 total points
ID: 18806589
In your command prompt type java -version and check the java version
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 1

Author Comment

by:rahulsurya
ID: 18806602
it says java 1.4.2_05
0
 
LVL 3

Expert Comment

by:el_dios
ID: 18806642
Using any IDE or using command prompt?
0
 
LVL 10

Expert Comment

by:Jaax
ID: 18806698
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
 
LVL 1

Author Comment

by:rahulsurya
ID: 18806699
i'm using shell on unix.

My application/programs run on unix server
0
 
LVL 1

Author Comment

by:rahulsurya
ID: 18806703
i don have enough permissions to update/ but i have jdk1.5.04 installed on the server
0
 
LVL 10

Expert Comment

by:Jaax
ID: 18806717
Use indexOf instead
(line.indexOf("=") > -1)
0
 
LVL 1

Author Comment

by:rahulsurya
ID: 18806735
i used complete path to javac in jdk1.5 and compiled and it worked
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18809236
indexOf () is reliable across versions
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question