r/learnjava • • Dec 18 '20

How do I run a java script

class Main{
    public static void main(String[] args){
        Console.log("Hello world");
    };
};

I have this saved as java file, however would like to have it run as a script. Not sure why it won't work, and how do I get it into browser?

1 Upvotes

5 comments sorted by

View all comments

11

u/[deleted] Dec 18 '20

[removed] — view removed comment

6

u/tatorwatt Dec 18 '20

Yup what this person said ^ it looks like you are confusing Java and JavaScript