简体   繁体   中英

Does Eclipse run Java or Javascript?

I have been learning programming language on Eclipse for around 2 months but until now, I thought Java and Javascript were the same. So I don't know which one I have been learning. Can someone tell me which one works on Eclipse?

EDIT - I found out that I have been learning Java thanks to you. Thank you all guys.

Vanilla Eclipse is only for Java. However, it can actually can be used for developing in both languages, especially given that JS does not require compiling. All you need is a plugin like Eclipse Web Developer Tools (see Introducing the Eclipse Marketplace Client for instructions on installing). There are also other Eclipse IDEs like Eclipse CDT that support languages like C++ and C# .

Take a look at this too.

Expanding on Cardinal System's answer , Java and Javascript are two very different languages. When it was created, it was named Javascript as a lightweight version of Java that was used on the web (in reality it is not this). Recently Javascript has been used outside of the browser, as with NodeJS and Deno . They share some similarities (such as using } ) but they are two very different languages.

By all likelihood you are learning Java (not JavaScript). You are correct, they are two very different languages, and quite often confused.

Java If you start out by something like public static void main(String[] args) , then it's Java for certain (and even if you don't, it may still well be). Here's a typical first program you see in Java.

class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!"); 
    }
}

(Here taken from the Programiz web site.) The call to System.out.println() is specific to Java too.

JavaScript If you embed your code inside tags in HTML, then it's JavaScript (and again, even if you don't, is may still be JavaScript). The following JavaScript example was taken from the Tutorialspoint tutorial.

<html>
   <body>   
      <script language = "javascript" type = "text/javascript">
         <!--
            document.write("Hello World!")
         //-->
      </script>      
   </body>
</html>

Other ways to make certain Also your course material, tutorial or text book should say what your language is.

Links

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM