Solved

Java method /Cannot resolve symbolerror

Posted on 2007-03-28
11
661 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 96
wild fly 8 startup error 2 79
restrict decimal places for double datatype 10 49
Session in java desktop 5 37
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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

734 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