Solved

Java method /Cannot resolve symbolerror

Posted on 2007-03-28
11
657 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now