Back

General Discussion

Discuss your favorites: TV shows, music, games and hobbies.
TOPIC | visual studio code help?
1 2
No matter what I do, the java debugger says that, in loose terms, I'm missing a class with the main method. Even when I try to run script like this, that I copied from the internet:

public class Main {
public static void main(String[] args) {
System.out.println("This will be printed");
}
{

It says the same thing. I've tried uninstalling, and it still doesn't work. Anybody know a solution? Should I just switch to using something else? I would like to get this to work since we use vscode in robotics, but if not, anything is appreciated. Thanks regardless :)
No matter what I do, the java debugger says that, in loose terms, I'm missing a class with the main method. Even when I try to run script like this, that I copied from the internet:

public class Main {
public static void main(String[] args) {
System.out.println("This will be printed");
}
{

It says the same thing. I've tried uninstalling, and it still doesn't work. Anybody know a solution? Should I just switch to using something else? I would like to get this to work since we use vscode in robotics, but if not, anything is appreciated. Thanks regardless :)
2ttpK.gif i love you all so much
seriously you guys are the best
he/him

wishlist
Buhek.gif
Hello fren! :D

Try changing the 'Main' function into main, with small m :)

+) Silly me, I forgot to ping you, @Lumynox ! XD
Hello fren! :D

Try changing the 'Main' function into main, with small m :)

+) Silly me, I forgot to ping you, @Lumynox ! XD
WHERE HER DREAMS END >
Unite we stand, divide we fall
| WD/WHDE | ~Plague~ | Any Pronounce | FRT+17(GMT+9) |

| ART SHOP | ACCENT SHOP | HATCHERY | feel free to ping!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
8c05f7199b7e3138b1bd09794101984bae36928e.png
@Lumynox
The last brace should be closed, not open. So } instead of {.
@Lumynox
The last brace should be closed, not open. So } instead of {.
@WHDE I tried that, didn't work :( I don't know if it's compiling in the wrong place or what, and I'm pretty new to this stuff.

@noodlemangos ah, i copied it wrong - it was originally set the proper way. Even after rewriting it properly, it still doesn't work.
@WHDE I tried that, didn't work :( I don't know if it's compiling in the wrong place or what, and I'm pretty new to this stuff.

@noodlemangos ah, i copied it wrong - it was originally set the proper way. Even after rewriting it properly, it still doesn't work.
2ttpK.gif i love you all so much
seriously you guys are the best
he/him

wishlist
Buhek.gif
@Lumynox
Could you message me/post a screenshot of the code + error? I think seeing it should help me figure out what's going on.
@Lumynox
Could you message me/post a screenshot of the code + error? I think seeing it should help me figure out what's going on.
@Lumynox

What does the compiler say?

Also class names should ideally be in capital first letter for Java. public class Main and not main is correct.
@Lumynox

What does the compiler say?

Also class names should ideally be in capital first letter for Java. public class Main and not main is correct.
Kunikuzushi
@Dessy @noodlemangos Not sure if both of you wanted an image, but here's whats happening [img]https://i.imgur.com/7ctJ9PV.png[/img] If that isn't what you needed to see, please let me know! Thank you for trying to help, I appreciate it.
@Dessy @noodlemangos Not sure if both of you wanted an image, but here's whats happening

7ctJ9PV.png

If that isn't what you needed to see, please let me know! Thank you for trying to help, I appreciate it.
2ttpK.gif i love you all so much
seriously you guys are the best
he/him

wishlist
Buhek.gif
@Lumynox
Two things:
Your code's missing a semicolon on line 4. Though, I don't think this is causing your error.
Second, it looks like, to run Java in VS code, you need an extension of some kind. The one it recommended me was "debugger for Java". Looking at the docs for this extension (and, assuming this is the one you have installed), I found it mentions this error here: https://github.com/Microsoft/vscode-java-debug/blob/master/Troubleshooting.md
Looks like there's some json file that needs to be configured.

I've never actually run java from VS Code before, just the command line-- I think this error is coming from whatever is used to run it. Other than the semicolon your code looks fine, and that error is definitely not being caused by missing it.
@Lumynox
Two things:
Your code's missing a semicolon on line 4. Though, I don't think this is causing your error.
Second, it looks like, to run Java in VS code, you need an extension of some kind. The one it recommended me was "debugger for Java". Looking at the docs for this extension (and, assuming this is the one you have installed), I found it mentions this error here: https://github.com/Microsoft/vscode-java-debug/blob/master/Troubleshooting.md
Looks like there's some json file that needs to be configured.

I've never actually run java from VS Code before, just the command line-- I think this error is coming from whatever is used to run it. Other than the semicolon your code looks fine, and that error is definitely not being caused by missing it.
@noodlemangos fixed that! I couldn't really figure out how to do what it said, but apparently I got it to work somehow? Hopefully it doesn't keep happening. Thank you for your help!!
@noodlemangos fixed that! I couldn't really figure out how to do what it said, but apparently I got it to work somehow? Hopefully it doesn't keep happening. Thank you for your help!!
2ttpK.gif i love you all so much
seriously you guys are the best
he/him

wishlist
Buhek.gif
@Lumynox Oh wonderful, glad to hear it. Hopefully it all works now!
@Lumynox Oh wonderful, glad to hear it. Hopefully it all works now!
1 2