Solved

Java method /Cannot resolve symbolerror

Posted on 2007-03-28
11
654 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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:mayankeagle
ID: 18809236
indexOf () is reliable across versions
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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.
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

758 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

19 Experts available now in Live!

Get 1:1 Help Now