Setting up environment variables for windows using GitBash

56 Views Asked by At

I am trying to set up several java jar files and packages as environment variables for a computational linear algebra class.

I am using the GitBash terminal on Windows OS.

I open the file ".bashrc" and use the following string

export CLASSPATH=$CLASSPATH:C:\Users\geniu\testclasspath.jar:.

The address is based on the "copy as address" command for the jar file I wanted to use.

I also tried different ways of acknowledging the root directory including "\c:", "\c\Users..." and starting with "\Users" as the examples on the course website show.

When I use the command:

echo $CLASSPATH.

The GitBash terminal shows no results, and the program provided by the professor used to test environment variables does not work. I eventually need multiple classpaths, which I believe require a ":" between each file location.

1

There are 1 best solutions below

0
redwards On

For git-bash (MSYS), you need to use forward slashes: /c/Users/geniu/testclasspath.jar

$ echo $CLASSPATH
/c/bin/

redwa@robert-lg MINGW64 ~
$ export CLASSPATH=$CLASSPATH:/c/Users/geniu/testclasspath.jar

redwa@robert-lg MINGW64 ~
$ echo $CLASSPATH
/c/bin:/c/Users/geniu/testclasspath.jar