How do you set environment variables for Enide / Nodeclipse? - eclipse

Anyone know how to set environment variables for running and debugging Node.js applications in Eclipse + Nodeclipse aka Enide Studio? For example, in a .js file, an environment variable can be referenced as process.env.PORT, for the environment variable PORT. How can I specify this variable within Enide?

I found the solution to my question. First, go to the menu item File > Properties. Then select Run/Debug Settings from the options on the left of the dialog. Then select the .js file for which you want to set an environment variable during debugging/running programs in Enide Studio / Eclipse + Nodeclipse. Then select the [Edit] button. On the dialog that appears, select the [Environment] tab. Then select the [New] button and enter in your desired variable name and value. Repeat for multiple environment variables. Click [Apply], then try running your program. Your environment values should be available as process.env.YOUR_VARIABLE_NAME in your Node.js source code.

Related

Append to PATH environment variable in Eclipse

How can I append or prepend a custom directory to the PATH environment variable in Eclipse CDT?
I am referring to the environment variables which can be specified at these locations:
for the C/C++ build environment
for C/C++ launch configurations
for external tool launch configurations
The custom directory should be prepended or appended to the PATH environment variable used by Eclipse itself (referred to as "native environment").
Attempting to set it the usual way (PATH=/my/custom/directory:${PATH}) does not work for launch configurations.
In a launch configuration you can use the env_var variable with the argument PATH:
${env_var:PATH}
Since plug-ins can contribute variables (e.g. git_branch by EGit) there is no documentation with a list of all variables and their arguments. In the New/Edit Environment Variable dialog, if you click Variables... and select the env_var variable, there is the following description at the bottom of the dialog (in my view the screenshot with env_var without arguments shown in the C/C++ Development User Guide is not correct here):
Returns the value of an environment variable. An environment variable
name must be specified as an argument.
In the C/C++ build environment, I would assume this would work too. But you've already found out that ${PATH} works here for sure.

Golang on eclipse: "Resource doesn't have a corresponding Go package" on Mac

As stated in the title, I have a problem running the Golang code on Eclipse. I'm currently using Mac, and I installed go by using homebrew.
Currently, the folder where go is installed is as follows.
/usr/local/Cellar/go/1.5.2/..
and after running Terminal and typing open ~/.bash_profile I added the following.
export GOROOT="/usr/local/Cellar/go/1.5.2/"
export PATH=$PATH:$GOROOT/bin
Am I still missing something else?
PS If I run the code using Terminal like go run main.go, I have absolutely no problem. The problem must be due to some misconfiguration in Eclipse.
I had the same error. Putting the source file under a sub-folder in src fixed it.
Go to 'Run Configurations' -> Filter with Go Application -> select your project and then click the Environment tab, then click on select button and tick the GOPATH environment. select apply and then Run.
I had the same problem and I did two things to solve it:
I opened Run configurations, filtered using "Go" and created a new configuration (right click on "Go Application" as a result of the filter). In the Environment tab added a new variable: GOPATH = [path to your workspace].
I had .go files right under src folder, and this is wrong. I created a folder under src folder and moved .go files to that folder.
The first step could be replaced by creating a system environment and adding it to the list using the "Select" option instead of creating a new one. I prefered to create a new one so I can run differente projects in the same laptop without having to change the value of the system environment.
Because the executable path is not right.
GoClipse compiles source into $project/bin, so we must set GOPATH = $project
Select project > Alt+Enter > Go Compiler > Use project specific settings > Eclipse GOPATH
In my case of wiki tutorial, GOPATH = :/home/sovann/go/wiki.
Then the IDE is able to locate /home/sovann/go/wiki/bin/main

How can I use an eclipse environment variable as GDB path?

I need to use a specific file as "gdb" executable in Eclipse. In the "Debug Configurations" window, "Debugger" tab for a C/C++ Application, one can specify the executable through path. I would expect it is also possible to refer to the executable using a Eclipse environment variable but I cannot find the proper way to write this.
I have declared DEBUG_EXEC as Eclipse environment variable through: Window -> Preferences -> General -> Workspace -> Linked resources. And made this variable point to a specific file on my harddrive.
How could I refer to this variable?
Is this possible?
This is an old post but it was highly ranked on Google, so here goes.
You can achieve what you want by creating your variable in Preferences -> Run/Debug -> String Substitution.
If you create a variable called gdb_path, you can then refer to it in the Debug Configuration as ${gdb_path}. It will also appear in the list of variables when clicking the Variables button next to the GDB Command text field.

Is it possible to add more than one environment variable to PyDev at once?

Running PyDev with Eclipse, I can see in the Run Configurations window how to add environment variables. You just click Add and provide the name and value.
I need to add over 20 of them to at least two configurations. Adding them one at a time is...suboptimal. There does not appear to be a function to add more than one at once.
Is there a way to add multiple environment variables at once? I already have them listed as =-separated pairs in a .txt file, if that would help.
You should be able to save the launch config as a file:
Run > run configurations > select launch > select common tab > save as > shared file: say where you want to save it.
Then, you can add a sample variable just to know how to enter it, open the .launch file and edit it as text to add the variables you want.
But still, just to note, this may not be what you're after... if you always have the same variables, you can simply create a .bat to configure those variables in a shell and launch eclipse from that shell to inherit those variables.
Or if you have already configured them in the shell, you could just select them in the environment tab (instead of putting 'new' each time, you can click 'select' and add multiple variables at once with the values already pre-configured).
Or if those variables are interpreter-dependent, you can configure them in the interpreter configuration (window > preferences > pydev > intererpreter - python > environment).

download jdk1.5.0_14

I download jdk1.5.0_14 and set environment variable JAVA_HOME and CLASSPATH.
Still it is not not working.
How can i download it?
I hope following steps are done:
Downloading the JDK 5 from this link
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-1.5.0_22-oth-JPR#CDS-CDS_Developer
Once you click on this link ,select
platform as windows and select the offline installation .
Once Download is completed(100%) , run the installation file (file will be
like this
jdk-1_5_0_22-windows-i586-p.exe) by double clicking the mouse.
Once installation is completed , the JDK will be default placed under
C:\Program Files\Java\jdk1.5.0_14
Now set the JAVA_HOME and CLASSPATH
Click on Start
Right Click My Computer from menu
Select Properties from Drop Down
Select Advanced Tab
Click on Environment Variable button
Click New button under the user variables Pane or legend
In the Dialog box under variable name
type JAVA_HOME and in variable
value type C:\Program Files\Java\jdk1.5.0_14
Click on Ok.
Click again New button in user variables Pane or legend
In the Dialog box under variable name type CLASS_PATH
and in variable value type
C:\Program Files\Java\jdk1.5.0_14;
C:\Program Files\Java\jdk1.5.0_14\lib;
Click on Ok.
Once done click on Ok and in subsequent windows.
Now Open a cmd prompt , by typing cmd from run menu , found when you click
on Windows Start button
once console is opened(a black
window) , type java -version ,
you may see help printed in the
screen and also type javac usage
will be printed .This means you are
ready to go.
Please check path again.
For example
In my machine the values are
CLASSPATH as C:\Program Files\Java\jdk1.5.0_14\lib;
and JAVA_HOME as C:\Program Files\Java\jdk1.5.0_14
It is your PATH variable
set PATH=%PATH%;C:\Program Files\Java\jdk1.5.0_14\bin
See Here
Download java 5 from here, install it, set JAVA_HOME environment
Try adding <java_install_dir>\bin (most likely C:\Program Files\Java\jdk1.5.0_14\bin) to your PATH environment variable. Be sure to separate it from everything else with a ;.