Questions tagged [cannot-find-symbol]

This tag is used when code returns an error message that a symbol cannot be located. These are usually compilation errors in Java.

This tag is used when code returns an error message that a symbol cannot be located. Such messages are usually associated with compilation errors in Java. See this post for a detailed description of causes and solutions: What does a "Cannot find symbol" compilation error mean?

220 questions
1
vote
2 answers

formatting JTextfields using another class

this is the code of the Gui Design class and below is the Class that provides functionality to the program. Im trying to get user input from the textfields so i can remove the text using the clearAll method and also save user input using the saveit…
1
vote
0 answers

java “cannot find symbol” - when importing from a library

So I have a java project (P1) (I am using Play Framework) in which I import a jar file (I generated from a different project I have (P2) ). I had to do few changes in project (P2) including renaming few variables. Then I regenerated the Jar file…
1
vote
2 answers

Error: cannot find symbol - method liesInt()

The task is to "change" the following program so that it is possible to create a subclass which enables the user to enter the numbers over Scanner: public class Patrick3 { static public void main(String[] emil) throws java.io.IOException { …
Phoney
  • 21
  • 3
1
vote
1 answer

ArrayList error - Cannot find symbol

I'm working on a final project for school and having some troubles. I have never done any programming in Java or really anything Object Oriented, so my code's likely not going to be that great. I'm having some issues with my array list. I am getting…
gmart
  • 23
  • 1
  • 3
1
vote
2 answers

Java - pass object as parameter in constructor

My gaol is to use an instance of a class as parameter for another class. I will describe my problem with an example. public class Color { public String color; public Color (String color) { this.color = color; } public Color…
Paul Ahuevo
  • 131
  • 1
  • 1
  • 13
1
vote
2 answers

Java error when passing arrays from other methods

I'm making a short quiz game where the user inputs their answers that are then stored into an array which is compared to an array containing the correct answers. I have two errors when I try and compile the code: Cannot find symbol: variable tar and…
1
vote
2 answers

ArrayList cannot find symbol

import java.util.*; public class GameMain{ public static void main(String [] args){ Scanner scan = new Scanner(System.in); Random rand = new Random(); Enemy e1 = new Knight(); Enemy e2 = new Skeleton(); Enemy e3 =…
1
vote
2 answers

Cannot find Collections.sort despite Comparable being implemented

I read through other questions here and found that when the compiler throws a Cannot find symbol for Collections.sort(List list) the problem was most often either... It was not passed a List List doesn't implement Comparable Importation of…
Legion Daeth
  • 329
  • 1
  • 3
  • 14
1
vote
0 answers

i can normally compile the file but when i run javac on it i get "cannot find symbol". What am i missing?

i am trying to create and object ExerciseLib with the following java code, and then call a method on the object to print a list: ExerciseLib entry = new…
1
vote
1 answer

Javac “cannot find symbol” Why?

My project directory looks like this: predictions --> WEB-INF --> classes --> predictions --> Predictions.java, Prediction.java, Prediction.class Prediction.java package…
Angel Gaona
  • 11
  • 1
  • 2
1
vote
1 answer

Yet another 'cannot find symbol' error when creating a new class object

In short, I'm trying to instantiate within the main method in order to handle computations. I wrote the main class in Eclipse and was able to compile and run everything smoothly. Main Method: public static void main(String[] args) { ... …
Oleg Silkin
  • 468
  • 1
  • 5
  • 12
1
vote
2 answers

Cannot find symbol on method

i'm creating the method toArray in the code below, getting cannot find symbol error in calling both pop() and push() methods inside toArray. Why? public void push(Comparable x) { arr[size++] = x; } public Object pop() throws…
1
vote
1 answer

Cannot find symbol on comparable array

I have to build a stack of comparable objects from a given interface. Inside the class, this is my constructor: public S() { Comparable[] arr = new Comparable[INITSIZE]; size = 0; } Now, in every method where the array appears, for…
1
vote
3 answers

Accessing the methods of a member of an Object[] array

I have to create an array of objects to then be randomly filled. In this array I need to put 100 random, Person(base) Student(sub), Professor(sub), Course(an array of Student plus a Professor), and a Circle(unrelated). I also have to name and count…
1
vote
1 answer

Cannot resolve symbol error when importing OpenCv4Android in Android Studio

I want to use OpenCV4Android in Android Studio. I downloaded OpenCV for Android from this link: http://opencv.org/downloads.html But, when I try to import it, I get different errors in Camera2Renderer.java like, Cannot resolve symbol 'camera2',…
Dania
  • 1,478
  • 2
  • 22
  • 51
1 2
3
14 15