Solved

Java method /Cannot resolve symbolerror

Posted on 2007-03-28
11
658 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
  • 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum5 challenge 5 84
Arrays.asList  VS  ArrayList 4 60
table example 4 29
web application structure 18 77
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

777 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