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.

I ported one of my projects (very alpha) over to Cloud9, the service of which is outstanding (really, really good). Because c9 is effectively running NodeJs on NodeJs for each workspace you define: I can run all of my Node tasks; I can Grunt in c9; nearly anything I can do on a "full" OS, I can do in c9.

Except for Java dependent tasks. Specifically with Grunt, there are a few tasks I can't run because no environment variable for Java can be found:

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:

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

knows all about Java. I can even export the path and run my Grunt tasks in the terminal--but only in this Terminal instance.

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? And if so, how?

Thanks for listening

  • and no, npm install java is not the answer

It looks like Cloud9 is tackling this themselves. 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.