formulahendry / formulahendry/vscode-code-runner
[Bug] Code Runner only runs Java class with the specific file name "InterLeaveArrays"; other capitalizations or letter combinations fail
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 351
- PR merge metrics
- No merged PRs in 30d
Description
- VS Code Version: 1.94.2 (system setup)
- OS Version: Windows_NT x64 10.0.22631
- Code Runner Version: v0.12.2
**Describe the bug**
I encountered a strange issue with Code Runner in VSCode when running a Java file named InterLeaveArrays.java. The program only runs correctly when the file name and class name are exactly InterLeaveArrays.java (with uppercase I, L, and A). Any other capitalization or letter combinations (e.g., InterleaveArrays, interLeaveArrays, InterLeavearrays, or InterLeaveARrays) fail to run.
The Code Runner always uses the command "cd "D:\my\file\path" && javac InterLeaveArrays.java && java InterLeaveArrays" for every file name I mentioned. This command generated by Code Runner is quite confusing. I have checked my Code Runner executor map, and there are no issues with it. Additionally, for other valid file names like "LeaveArrays.java" or "InterArrays.java", everything works perfectly.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a Java file named interleavearrays.java with the following content
```java
public class interleavearrays {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
```
2. Run the file using Code Runner.
3. Change the capitalization of the class name and file name (e.g., InterleaveArrays, interLeaveArrays, InterLeaveARrays) and try running it again.
**Actual behavior**
The command generated by Code Runner is:
```cd "d:\file\path" && javac InterLeaveArrays.java && java InterLeaveArrays```
**Expected behavior**
The command generated should be like this: ```cd "d:\file\path" && javac interleavearrays.java && java interleavearrays```
The Java file should run successfully regardless of capitalization, as long as the class name matches the file name.
**Screenshots**
I apologize if my language was unclear. Here is the explanation:
"错误: 找不到或无法加载主类" means “Error: Could not find or load main class”
“原因” means “Cause”

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.