Open Vladislav0Art opened 3 days ago
... Actually, I get the following error when running kotlinc from command prompt. So it seems the problem is in the kotlinc path, not in the location where the files are saved (at least not yet).
'java' is not recognized as an internal or external command, operable program or batch file.
My path to kotlinc (according to TestSpark) is following
"C:\Users\my_user_name\.gradle\caches\8.8\transforms\59dd4cdd51e5ae6cd765ecd455ab2df8\transformed\ideaIC-2024.2.3-win\plugins\Kotlin\kotlinc\bin\kotlinc"
https://github.com/JetBrains-Research/TestSpark/pull/406#issuecomment-2443609308
So... I debugged the problem a bit more and found out that the reason I get
'java' is not recognized as an internal or external command, operable program or batch file.
is because I do not have java in my path variable. To overcome this problem, you can change the command to include the java path or add it to the path variables of your system. The former will probably resolve the issue for all windows machines, while the latter will resolve the issue only on a local machine.The new command will look something like
C:\Program Files\Java\jdk-11\bin\java -jar path\to\kotlinc.jar -cp . -d out src\main\kotlin\Main.kt
according to Bing Copilot. I tried it, and it seems to work.
https://github.com/JetBrains-Research/TestSpark/pull/406#issuecomment-2443663083
Never mind, I could not fix. I got an Invalid or corrupt jarfile
file because kotlinc is not a jar file and java cannot run it.
@Vladislav0Art I think the problem you described with regard to the Calculator is a Kotlin problem, not TestSpark. Update: never mind, I just cannot write kotlin code without an IDE. It's been a long day.
Describe the bug
Kotlinc tests cannot be compiled successfully on Windows due to an unresolved symbol error.
I have
java
installed on my machine and present inPATH
, which allowshotline
to execute successfully. However, there is potentially another issue when no java in PATH is present (TODO(@Vladislav0Art): check it!). A potential solution is to search for Java on Windows as well.There is a warning that the file location does not match its package:
The file is located under:
Here is the type of error I get for all test cases:
To Reproduce Steps to reproduce the behavior:
Expected behavior Kotlin compilation should work on Windows.
Additional context Compilation for Java works fine on the other hand.