#Cannot Find Symbol for the other file

13 messages · Page 1 of 1 (latest)

late oracle
#

So I have 2 java files named Chicken.java and Lab1.java

After typing this in the terminal:
PS C:\Users\ASUS\Desktop\BSCS 3-1st Sem\CMSC 22 OOP\CMSC 22 LAB\Lab1Main\labpackage> javac Lab1.java

I am getting this error:
Lab1.java:11: error: cannot find symbol
Chicken chicken1 = new Chicken();
^
symbol: class Chicken
location: class Lab1
Lab1.java:11: error: cannot find symbol
Chicken chicken1 = new Chicken();
^
symbol: class Chicken
location: class Lab1
2 errors

pseudo spadeBOT
#

This post has been reserved for your question.

Hey @late oracle! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

uneven robin
#

You need to run javac from outside of the package. Be in C:\Users\ASUS\Desktop\BSCS 3-1st Sem\CMSC 22 OOP\CMSC 22 LAB\Lab1Main> and point to the files in package labpackage

late oracle
uneven robin
#

Yes, you need to point to the files inside the package

#

There's nothing called Lab1.java where you are

late oracle
uneven robin
#

labpackage/Lab1.java

late oracle
uneven robin
#

You stay outside of the package, and you run labpackage.Lab1

pseudo spadeBOT
# late oracle ohmygod thank u

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.