简体   繁体   English

如何在Cloude 9(c9)IDE中设置PATH环境变量和/或运行需要Java的npm模块

[英]How to set PATH environment variables in Cloude 9 (c9) IDE and/or run npm modules requiring Java

For various reasons (and because of a recent back injury), I needed to get an "ultra-light" laptop. 由于各种原因(以及最近的背部受伤),我需要购买一台“超轻型”笔记本电脑。 I went with the recently best-selling Samsung Chromebook , and I can actually get quite a lot of real work done. 我选择了最近最畅销的Samsung Chromebook ,实际上可以完成很多实际工作。

I ported one of my projects (very alpha) over to Cloud9 , the service of which is outstanding (really, really good). 我将我的一个项目(非常Alpha)移植到了Cloud9上 ,该服务的服务非常出色(真的非常好)。 Because c9 is effectively running NodeJs on NodeJs for each workspace you define: I can run all of my Node tasks; 因为c9在您定义的每个工作区的NodeJ上有效地运行NodeJ,所以:我可以运行所有的Node任务; I can Grunt in c9; 我可以在c9中咕Gr一声; nearly anything I can do on a "full" OS, I can do in c9. 我几乎可以在c9上完成的所有工作都可以在“完整”操作系统上完成。

Except for Java dependent tasks. 除了Java依赖的任务。 Specifically with Grunt, there are a few tasks I can't run because no environment variable for Java can be found: 特别是对于Grunt,由于无法找到Java的环境变量,所以我无法执行一些任务:

JAVA_HOME is no set, but java is required by jsdoc to run.

Never-minding the grammar, it is possible to run jsdoc (or closure-compiler, etc) by opening c9's proper Terminal which: 不用担心语法,可以通过打开c9的适当Terminal来运行jsdoc(或closure-compiler等):

somecallmechief@ojs:~/406658 (master) $ which java                                                                                                                                                            
    /usr/bin/java                                                                                                                                                                                                 

knows all about Java. 完全了解Java。 I can even export the path and run my Grunt tasks in the terminal--but only in this Terminal instance. 我什至可以导出路径并在终端中运行我的Grunt任务-但只能在此Terminal实例中。

Given that Java is clearly part of my virtual workspace, is it possible to define the JAVA_HOME environment variable as a constant/persistent value? 鉴于Java显然是我的虚拟工作区的一部分,是否可以将JAVA_HOME环境变量定义为常量/持久值? And if so, how? 如果是这样,怎么办?

Thanks for listening 谢谢收听

  • and no, npm install java is not the answer 不, npm install java不是答案

It looks like Cloud9 is tackling this themselves. 看来Cloud9正在自己解决这个问题。 Based on their latest blog post , the former 'Console' is no more. 根据他们最新的博客文章 ,不再有以前的“控制台”。 Instead you get the Terminal right out of the box, and since it's a fully baked, fully configurable bash terminal--that's all you need. 取而代之的是,您可以直接使用终端,并且因为它是一个完全烘焙,完全可配置的bash终端-这就是您所需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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