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
I have installed JDK, VSC, and CodeRunner(btw, I have already set the path for JAVA correctly). However, when I try to use CodeRunner, there is always a same error message express: "error: class learn1 is public, should be declared in a file named learn1.java", and please see the picture below.
I am very sure that I named the class which is same as the file name.
[Running] cd "d:\Dropbox\coding\practices\JAVA\src" && javac temp-msvqqxjdsd.java && java temp-msvqqxjdsd
temp-msvqqxjdsd.java:1: error: class learn1 is public, should be declared in a file named learn1.java
public class learn1 {
^
1 error
[Done] exited with code=1 in 5.295 seconds
I can use the Eclipse Neon for JAVA EE to compile can run the same file correctly. Do I need to setup anything before I use the feature in VSC? VSC is very cool and light, and I really want to use it to learn developing JAVA application. Please help me to figure out this problem. Thank you so much!
The text was updated successfully, but these errors were encountered:
@formulahendry
Thank you!!! Your are awesome! I tried to fined the solution for two days, and it seems few of people had faced this problem before.
It's very wonderful to know the tip! Thank you again! 👍
Dear all:
I have installed JDK, VSC, and CodeRunner(btw, I have already set the path for JAVA correctly). However, when I try to use CodeRunner, there is always a same error message express: "error: class learn1 is public, should be declared in a file named learn1.java", and please see the picture below.
I am very sure that I named the class which is same as the file name.
http://imgur.com/m52uJua
the whole message is:
I can use the Eclipse Neon for JAVA EE to compile can run the same file correctly. Do I need to setup anything before I use the feature in VSC? VSC is very cool and light, and I really want to use it to learn developing JAVA application. Please help me to figure out this problem. Thank you so much!
The text was updated successfully, but these errors were encountered: