You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Project build / compilation fail when we try to run any class. #179
Hi,
Whenever we try to run any class locally the IDE gives compilation error for many classes due to not properly following coding standard.
I will take ownership and try to fix all issues, so next time whenever a new / existing contributor try to run any file then there wont be any compilation issue.
Main Problem: Public class names and filenames do not match
Java requires that a public class must be in a file with the same name as the class.
Class AreaRect is public, should be declared in a file named AreaRect.java
You do have areaRect.java, but the file name starts with a lowercase 'a'.
Java is case-sensitive, so areaRect.java is not same as AreaRect.java.
To fix:
Rename all your files so the filename matches the public class name exactly (case-sensitive).
Remove the public modifier if you want to keep multiple classes in one file (not common for large programs).
Also fix this issue shown in the log:
Your file is not inside a directory named area, but your class declares package area
You either need to remove or fix the package declaration, or put the file inside a folder called area/ inside your Programs folder.
If you're not using packages explicitly, just remove the package declarations at the top of each file.
Activity
Krish-Jain30 commentedon Apr 6, 2025
Main Problem: Public class names and filenames do not match
Java requires that a public class must be in a file with the same name as the class.
Class AreaRect is public, should be declared in a file named AreaRect.java
You do have areaRect.java, but the file name starts with a lowercase 'a'.
Java is case-sensitive, so areaRect.java is not same as AreaRect.java.
To fix:
Rename all your files so the filename matches the public class name exactly (case-sensitive).
Remove the public modifier if you want to keep multiple classes in one file (not common for large programs).
Also fix this issue shown in the log:
Your file is not inside a directory named area, but your class declares package area
You either need to remove or fix the package declaration, or put the file inside a folder called area/ inside your Programs folder.
If you're not using packages explicitly, just remove the package declarations at the top of each file.