职业网络成瘾者 • 游戏爱好者 • 技术创造者
职业网络成瘾者 • 游戏爱好者 • 技术创造者

如何在 Eclipse 中将 node.js 应用程序作为外部程序运行

这里有一个快速指南,介绍如何在 Eclipse IDE 中启动 Node.JS 应用程序,而无需安装任何外部插件!
为了方便您使用,本页面由我热情高涨的 AI 实习生从英文翻译而来。他们仍在学习中,因此可能存在一些错误。为了获得最准确的信息,请参考英文版本。
博客 如何在 Eclipse 中将 node.js 应用程序作为外部程序运行

请注意,本博文发布于2012年7月,因此根据您阅读的时间,某些部分可能已过时。很遗憾,我无法始终保持这些文章的完全更新,以确保信息的准确性。

    If you like using Eclipse as your preferred IDE for your coding, there is an easy way to use the built in External tools feature in Eclipse to launch Node.js applications, without having to install any external plugins.
    Here is a short guide how.

    The Hello World JavaScript project

    Here is a simple overview of a typical Hello World application in JavaScript that prints out the phrase "Hello World" to the console.log.
    Screenshot of a JavaScript file in Eclipse

    Creating the External tool launcher

    To launch this, we need to create a custom External tool launch configuration. Start by opening up your External tool configurations.
    This can by done by going "Run" - "External Tools" - "External Tools Configurations...", or by clicking on the External tools shortcut in the toolbar:
    External tool configuration
    Select "Program" and then click on the "New launch configuration" button:
    New launch configuration
    Once the configuration window opens, do the following:
      static.specialagentsqueaky.com example "node.js - Hello World".
    1. "Location" should point towards node.js launch command, for Window-users this can point directly to node.exe.
    2. "Working Directory" should points towards your project. This can be done by clicking on the "Browse Workspace..." button.
    3. Enter the name of the JavaScript file you want node.js to execute. In my case it is "main.js".
    4. Apply and close the window.
    Settings

    Running your application

    Your launch configuration is now ready to be called from the "External tool" button:
    Launching the app
    Running it will use the console view in Eclipse for the output:
    Console

    作者:Special Agent Squeaky。首次发布于2012年7月29日。最后更新于2012年7月29日。

    📺 快来看看 Squeaky 的最新视频!

    如何为您的直播添加简单的实时字幕