Environment Variables

Do you want to quickly open any folders you need, launch Command Prompt from any directory, or create automatic scripts for moving files? Then you just need to know what environment variables are!

Today’s article, I think, will be of interest, first of all, to advanced Windows users. Although, in principle, it won’t hurt anyone to know about the subject of the conversation. We are talking about such an essence of the operating system as environment variables(emphasis on the last syllable).

The executable environment in Windows is the shell (CMD.EXE). Accordingly, these variables will work primarily in the console. However, since Command Prompt is supported at the system level by all standard using Windows, environment variables will also work fine in, for example, Explorer, Task Scheduler, or any BAT files. This gives wide scope for their use in the field of automation of routine processes when working with files.

General information about environment variables

Environment variables are most often divided into system and local variables. System can, in turn, be built into Windows natively (have highest priority) or added by various installed programs. Such variables are available from any account and are stored in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.

Local Environment variables can also be created programmatically, however, they are often created manually by users themselves. Such variables are only available within the active at the moment user account, and are stored in the registry in the HKEY_CURRENT_USER\Environment and HKEY_CURRENT_USER\Volatile Environment branches.

Physically, an environment variable is a string or multi-string registry value. Its name is at the same time the name of the variable, and the value, accordingly, is its content. The content can be any text information, commands, folder paths, or even references to other variables. IN the latter case The name of the variable being referenced is surrounded on both sides by "%" characters:

By the way, the above method of framing a name environment variable percent signs are used to call its value in Windows environment. For example, if on the Command Line you want to display current date, You can use the ECHO command and the DATE variable in the format: "echo %date%" (without quotes). Variable values ​​can be arbitrarily combined with any text or values ​​of other variables, provided that you also enclose their names in the “%...%” construction:

Think, general idea You already know what environment variables are, so let’s dive into them and look at them in more detail.

Windows Environment Variables

As we have already found out, you can view existing environment variables in the registry. However, this is not entirely convenient, since they are scattered over several branches. Much easier to get acquainted with full list available environment variables via the Command Line. To do this, call it (WIN+R - cmd - Enter) and enter the command SET without any additional parameters:

It is worth saying that the list here is a little incomplete, since it does not contain a number of built-in system variables, such as DATE, TIME, RANDOM, etc. Let's start with them, perhaps.

System Environment Variables

Variable Typical value Purpose
APPDATA C:\Documents and Settings\%UserName%\Application Data or C:\Users\%UserName%\AppData\Roaming (Windows 7 and above)
CMDEXTVERSION number Returns the version of Command Processor Extensions.
COMMONPROGRAMFILES Typically: %ProgramFiles%\Common Files Stores the path to the Common Files directory.
COMMONPROGRAMFILES(x86) Typically: %ProgramFiles(x86)%\Common Files Stores the path to the 32-bit version of the Common Files directory on 64-bit systems.
COMPUTERNAME Text Stores the name of your computer, used for identification on networks.
COMSPEC C:\Windows\system32\cmd.exe Contains the path to the Command Line launch file. When you enter a variable in the address bar of Explorer, it launches the console from the current folder.
DATE Current date Displays the full current date in the format specified in the Date and Time settings.
ERRORLEVEL Number or 0 Stores the numeric error code that occurred in the last command used. If there are no errors, it displays 0.
HOMEDRIVE C:, D:, E: or other letters Returns the drive letter on which the user profile is stored.
HOMEPATH Typically: \Users\%USERNAME%
HOMESHARE Path, if any If given, stores the path to shared folder in the directory with the user profile.
LOCALAPPDATA Typically: C:\Users\%UserName%\AppData\Local Stores the path to the folder with local data of installed programs.
NUMBER_OF_PROCESSORS Number Displays the number of processor cores in the system.
OS Text Displays the name of the architecture of your version of Windows (most often Windows_NT for systems older than Windows 2000).
PATH A series of paths Stores (separated by semicolons) a list of paths to various folders with executable files of system and other applications.
PATHEXT File extensions (.COM; .EXE; .BAT, etc.) Stores (separated by semicolons) a list of file extensions that are perceived by the system as executable.
PROCESSOR_ARCHITECTURE Text Displays the architecture code of the processor installed in the system (for example, AMD64).
PROCESSOR_IDENTIFIER Text Displays the processor architecture code, as well as a number of additional information about him ( model range, model version, etc.).
PROCESSOR_LEVEL Number Displays the processor architecture level code (model range).
PROCESSOR_REVISION Number Gives the processor revision number.
PROGRAMDATA Typically: C:\ProgramData\ Stores the path to the directory with data of installed programs.
PROGRAMFILES Typically: C:\Program Files\ Stores the path to the default program installation directory.
PROGRAMFILES(x86) Typically: C:\Program Files (x86)\ Stores the path to the default installation directory for 32-bit programs in 64-bit Windows.
PUBLIC Typically: C:\Users\Public\ Stores the path to general catalog systems (folder "General").
RANDOM Number from 0 to 32767 Issues random number from 0 to 32767.
SAFEBOOT_OPTION Text Exists only in mode Safe boot and stores the code current mode operation (for example, in download mode "with support command line" - Minimal or "with support network drivers" - Network).
SYSTEMDRIVE C:, D:, E: or other letters Stores the drive letter on which the system is installed (usually the same as %HOMEDRIVE%).
TEMP and TMP Typically: C:\Users\%USERNAME%\AppData\Local\Temp\ Stores the path to the user's temporary folder. The variable is both system and user to provide access to folders from other accounts.
TIME Current time Issues current time in the format: hours:minutes:seconds.milliseconds.
WINDIR Typically: C:\Windows\ Stores the path to system directory Windows.

Local Environment Variables

If system environment variables are always available throughout the system, then local ones work only within a specific user account. Their number can be significant, and their composition can differ even for different users the same PC. However, there are a number of variables that are usually present throughout.

Variable Typical value Purpose
ALLUSERSPROFILE Typically: C:\All Users (before Windows XP) or C:\Program Data (Windows 7 and above) Stores the path to the folder with data of installed programs.
CD Path Stores the path to the current active directory in which commands are executed.
CLIENTNAME Text (if exists) If set, stores the computer name specified in the current user's settings.
CMDCMDLINE Text Issues full team(with parameters) that was used to last launch Command Prompt.
LOGONSERVER Text Stores the current user's domain controller name.
PROMPT Usually: $P$G Returns command line options for the current interpreter.
SESSIONNAME Typically: Console Displays the type name of the current Command Line session. When running from a local PC, it is set to "Console". At remote call- "RDP-Tcp#<номер сеанса>".
USERDOMAIN Text Stores the name of the domain (computer) in which the user works.
USERNAME Text Stores the account name of the active user.
USERPROFILE Typically: C:\Users\%USERNAME% Returns the path to the directory with the user profile.

Creating and editing environment variables

As you can see, quite a lot of environment variables already exist initially. However, this does not mean that you will use them all and must remember them by heart. Moreover, in practice you may be missing some values ​​and may want to create your own environment variables. Fortunately, Windows has at least three standard ways to do this!

Creating Environment Variables in Registry Editor

As we already said, environment variables are stored in Windows registry. Accordingly, we can create and edit them there. This is not the most the right way, but, nevertheless, such a possibility exists.

To create, for example, a local environment variable, open the Registry Editor (WIN+R - regedit - Enter) and in the HKEY_CURRENT_USER\Environment branch create new parameter an extensible string, string, or multistring type with the desired name and value. For example, let's create a variable MYNAME with the value "Ruslan":

For the variable to become available in the system, you need to either restart Windows or just the Explorer itself. The latter can be done quite simply using the Task Manager (CTRL+SHIFT+ESC). You just need to find the "Explorer" process (or explorer.exe) and restart it (or, more earlier versions Windows, remove the task and create it again):

After restarting the Windows shell, the added variable will be available in all system components. You can check availability, as always, in the Command Line using the ECHO command (echo %myname%).

Creating Environment Variables on the Command Line

If you are already used to working in Windows console, then you can create environment variables directly in it. To create and edit variables in the Command Line, use the already familiar SET command. Only, if we used it without any parameters to display a list of variables, now we will need to supplement the command with the name of the variable and its value. For example, you can create the MYSURNAME variable with the value “Tertyshny” like this: SET MYSURNAME=Tertyshny:

You can check the availability of a variable not only with the already familiar ECHO command, but also using the same SET indicating the variable name: SET MYSURNAME. If you append the "=" sign to the previous command, then the resulting function will delete the environment variable from specified name eg: SET MYSURNAME= (will remove the MYSURNAME variable).

When creating environment variable It was displayed there directly in the registry, but access to it required a restart of the environment. When creating in the console, a restart is not needed. The new variable becomes available immediately after it is declared. True, it is not saved anywhere on an ongoing basis and can only be used in the current Command Line session.

To save such a variable to the registry, you will need to manipulate the REG command. For example, to save a variable as local team will be as follows: REG ADD HKCU\Environment /v MYSURNAME /t REG_EXPAND_SZ /d Tertyshny or REG ADD HKCU\Environment /v MYSURNAME /t REG_EXPAND_SZ /d %MYSURNAME%:

Creating Environment Variables via System Properties

The safest and most convenient for the average user, in my opinion, is to work with environment variables through the equipment of the same name. To access it call "System Properties"(context menu of the "Computer" icon - "Properties"), go to "Advanced" tab and press Environment Variables button at the very bottom:

In the window that opens, you can manage some existing system and local environment variables, as well as create new ones. In principle, there is nothing complicated here - everything is very clear. To create a new variable, you only need to fill in two fields with its name and value. As in the case of adding a variable through the registry, this also requires a restart of the environment for full operation.

Examples of using environment variables

We have finally figured out (I hope :)) the principles of creating and changing environment variables and now we will look at a few practical examples their applications. I’ll say right away that you can come up with a lot of applications yourself. And, if you understand the syntax of BAT files, then very extensive opportunities will open up for you.

One of the most useful system environment variables, in my opinion, is %COMSPEC%. If we look at its meaning, we will see that it launches the Command Prompt. However, if you enter this variable in the address bar of the currently open folder, the console will automatically open from that directory. This “trick” is very convenient if you work with console applications and do not want to manually enter the address of the folder with executable files every time:

Often when working with the console you need to get the path or name working folder. In order not to enter it, again, manually, it is much more convenient to use the system environment variable %CD%. This variable, as we know, stores the path of the currently active directory.

Variables that store paths in their value are quite convenient to use for quick transition To the necessary folders in the same Explorer. For example, to open temporary files directory the user just needs to enter in address bar %TMP%, and to access the folder Windows - %WINDIR% and press Enter. Here you can create your own variables, for example, %DWNLD% for opening the downloads folder, %DSK% for the Desktop, etc.

Let's consider a popular practical task that uses the above-mentioned type of variables - cleaning the directory with temporary files. As we know, often various programs They don’t “clean up” their “garbage”. As a result, the temporary files directory slowly but surely increases in size. If you want to automate its cleaning, create a BAT file with the following content:

The first command will delete the temporary files directory with all subfolders without asking for your confirmation. The second will create it again. It is worth noting, however, that if you launch such a “batch file” while the system is running, the TEMP folder may not be completely deleted, since it may contain resources used active programs. In principle, this is not fatal, but the console will display errors.

If you want everything to go flawlessly, it is better to run the cleanup at Windows startup by dropping the BAT file into (usually the path: %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup). Thus, cleaning will occur automatically every time the system starts and will not be blocked by active processes, since they have not yet started.

In some cases, the variable can also be useful %RANDOM%. By default, it generates a random number from 0 to 32767. However, the range can be limited by assigning after the variable the construction "%% number", where "number" is the maximum desired value of the range. For example, you can get a number from 0 to 10 like this: “ECHO %RANDOM% %% 11” (there are only 11 numbers in the range, including 0). With a little confusion, you can even write a simple game “Guess the number” in the form of the following BAT file:

SET /a GUESS=%RANDOM% %% 101

SET /p "try=Your number: "

if "%try%"=="" goto begin

if %try% LSS %GUESS% (echo The hidden number is greater.& goto begin)

if %try% GTR %GUESS% (echo The hidden number is less.& goto begin)

if %try%==%GUESS% echo You guessed it right!& pause

The above code implements a game of guessing a number from 0 to 100, which is obtained precisely from the system environment variable %RANDOM%. To display the Cyrillic alphabet normally, the set of commands must be saved as a BAT file with OEM 866 or DOS encoding (it is designated differently in different Notepads). You can quickly run it from any folder using the above method using the %COMSPEC% variable and entering the BAT file name:

Conclusions

Despite the fact that environment variables in most cases are used only system administrators and programmers, they can be of great use and ordinary users! Knowing just a few of them and being able to create your own, you special problems you can at least receive quick access to any necessary folders.

If your interest is greater than just trying what it is, then you can go further and write your own batch files, automating the processes of deleting, moving and creating files with the data you need. And even if the Command Line is not as functional as, say, Linux console bash, in in capable hands she can literally work miracles! Don't believe me? Try it yourself!

P.S. Permission granted to freely copy and quote. this article subject to indicating open active link to the source and preservation of the authorship of Ruslan Tertyshny.

T-FLEX CAD variables are auxiliary elements of the system that allow you to set various types non-geometric relationships between drawing elements.

For example, variables can be specified as construction line parameters. In this case, the value of the construction line parameter will be determined by the value of the variable. If the value of a variable changes, the value of the associated construction line parameter (for example, the radius of a circle or the position of a straight line) will automatically change. Using variables, you can set the color and visibility of drawing elements, hatch parameters, text content, various parameters etc. Variables can also be used when creating a 3D model.

By specifying relationships between the values ​​of variables that determine the parameters of construction elements and drawing images, you can achieve automatic change entire drawing when the value of one or more basic variables changes.

Creating Variables

In the T-FLEX CAD system, variables can be created in different ways:

using the variable editor;

when setting and editing parameters of construction lines, as well as other elements of a drawing or 3D model;

in a text editor;

when asked text strings in the parameters of some elements;

when setting the values ​​of almost all real parameters of elements (levels, priorities, etc.).

The main tool for working with variables isvariable editor. With its help you can perform all actions on them.

You can read more about creating variables in separate sections:

Characteristics of variables

Before moving on to the description of the variable editor itself and how to work in it, let’s consider the main characteristics of any T-FLEX CAD variable.

When creating any T-FLEX CAD variable, you must specify:

● unique name of this variable, allowing it to be uniquely identified in the document, as well as determining the type of this variable ( is it textual or real);

● expression , from which the system will calculate the current value of the variable.

In addition, there are a number of other additional characteristics variables that are set if necessary. Some of them allow you to assign variables additional properties(for example, signexternal variable). Others are used solely to make it easier to work with a large number of variables in a document ( variable comment, variable group).

Rules for specifying variable names

Standard Math Functions

Special functions of T-FLEX CAD

Functions for working with the internal database

Function for working with an external database

It does not matter which letters are used to write the function name: uppercase or lowercase.

When specifying an expression for a variable, consider the type of the variable. Real variables can only take numeric values ​​(12; 125; -234; 781.234; 3.834e+6), text variables can only take symbolic values ​​(“Text”; “String”; “Name”).

The expression can simply be a constant (numeric or symbolic, depending on the type of the variable).

Function Variables

In addition to various mathematical and special functions predefined in the system, when composing expressions for variables, you can describe and use your own user functions. For example, if expressions describing variables use many similar, cumbersome expressions that differ only in individual arguments, you can describe own function, accessing which will replace expressions. Custom functions are specified using variables of a special type -variable-functions.

A function variable is a description of a user-defined function. The expression for it is compiled according to the same rules as for a regular variable. The occurrence of function arguments in an expression is indicated as follows (the number of arguments is not limited):

#1 – first argument,

#2 – second argument, etc.

The function described in this way can be used in the variable editor when setting the values ​​of other variables. When calling a function, variable names or numeric values ​​are supplied as arguments. The number of actual arguments must be equal to or more quantity formal arguments.

For example, if a function variable was defined like this:

FUNC=(#1+#2)*10,

then calling FUNC (L, 20, 30) will not be an error.

In the list of variables of the current document, empty parentheses “()” are automatically added to the name of the function variable..

List of variable values

For any T-FLEX CAD variable you can specify a list of values. More precisely, a list of expressions, because a variable list can contain any values, not necessarily constants. Even for a function variable, you can specify a list of various expressions. After this, the value of any variable, or rather, the expression that determines this value, can be selected from the created list.

The list is created as a set of strings containing the required constants or expressions. In addition, the list can be created based on already existing file, internal database, materials list (in 3D version) or calendar (the last two options are only possible for text variables).

The list specified for the variable will appear in all places where the value of this variable is specified (in the variable editor, in the “M: Edit model parameters” command, when setting fragment variables). The value entry field for such a variable will contain a graphical button that allows you to call up a list of values. To access the list of values, just point the mouse cursor at the button and click. As a result, a list will appear on the screen from which you can select a new value (expression).

An environment variable in Windows stores information about OS settings and user data. It is indicated using a paired symbol «%» , For example:

Using these variables you can pass necessary information operating system. For example, %PATH% stores a list of directories in which Windows searches for executable files if the path to them is not specified explicitly. %TEMP% stores temporary files and %APPDATA%— user program settings.

Changing environment variables may help if you want to move the folder "Temp" or "AppData" to another place. Editing %PATH% will allow you to run programs from "Command line" without indicating every time long way to the file. Let's look at methods that will help achieve these goals.

Method 1: Computer Properties

As an example of a program that needs to be launched, we use . Trying to activate this application from "Command line", you will get this error:

This happens because you didn't ask full path To executable file. In our case, the full path looks like this:

"C:\Program Files (x86)\Skype\Phone\Skype.exe"

To avoid repeating this every time, let's add the Skype directory to the variable %PATH%.


Ready! Now you can run any program, not just Skype, from any directory in "Command line".

Method 2: "Command Line"

Consider the case when we want to set %APPDATA% to disk "D". This variable is missing in "Environment Variables", so it cannot be changed in the first way.


Changing the values ​​of environment variables requires some knowledge in this area. Do not play with the values ​​and do not edit them at random, so as not to harm the OS. Study the theoretical material well, and only after that proceed to practice.

In ActionScript, as well as in languages ​​such as Pascal or JavaScript, you can declare a variable using keyword var:

Var new_obj; // New variable created...

When assigning a name to a variable, you must follow the rules for specifying identifiers. It is especially important to remember that ActionScript now has full case sensitivity, and that a name cannot begin with a number and cannot match tokens from the language dictionary. When a variable is created, it is automatically assigned the value undefined:

Trace(new_obj); // Outputs: undefined

However, variables are rarely declared empty. Usually they are immediately associated with some specific value (at worst - null). This is done using the “-” assignment operator, which we have used dozens of times already:

Var new_obj=null; // If the variable initially has no value,
// then it needs to be assigned null

You can declare several variables at the same time, for which you need to use the “,” operator:

Var a=1, b=2, c=3; // String is equivalent to var a=1; var b=2; var c=3;

If a variable will store data objects of only one type, it should be typed.

How to do it:

Var number:Number=0;

In Flash 4, before the advent of modern ActionScript, the set(name, expression) clause was used to declare and redefine variables, where name is the Name and expression is the expression to assign. For example:

Set(a, null); // Equivalent to a=null;

Currently, the functions of the set() clause have been narrowed to creating variables with dynamic names:

Var i:Number = Math.round(Math.random()"10); // Generate random
// number from 0 to 10
set("var"+i,"new variable"); // Create a variable with a random name
trace(eval("var" + i)); // Outputs: "new variable"

It must be admitted that in modern versions Flash's set() clause is used quite rarely, due to the fact that it has a much more powerful competitor - arrays (more precisely, the property access operator "()", which is often called the array access operator - partly because similar to the array literal ""). However, if arrays are not used, then set() is simply irreplaceable (and was so in Flash 4), since it is impossible to assign a value to a variable by converting a string to an identifier using eval():

Eval("variable")=3; // This line causes an error
set("variable",3); // Valid expression

To create a variable with a dynamically generated name more technically than using the set clause, you need to use the following notation:

This["name"]=value,

Where this is a pointer to the current timing diagram (its properties are all the variables of the code placed on it); "name" - variable name; value is the data object that the variable should store.

For example:

This ["variable"] = "Hello";
trace(variable); // Outputs: Hello

Variables that are created using the set clause or the "operator" cannot be typed. However, it is more correct to talk about creating a timing diagram property containing code than about a variable.

It is good practice in ActionScript programming to declare all script variables in one place - in a commented area at the top of the code sheet. This approach helps avoid repetition of identifiers in large programs, and also makes the script more readable and understandable for third parties. It is quite justified to declare service variables along with the main variables - to store intermediate results or status flags.

//*******Variables********************************
var speed:Number=10; // Object speed
var size:Number=100; // Object size in pixels
var crash:Number=null; // Distance by duplicate
//**************************************************

There is a more significant reason why all variables must be declared at the beginning of the script.

To understand it, analyze the following code:

Function func():Void ( // Function that calls the ones written after it
// variable and function
trace(per);
func2();
}
func(); // Outputs: undefined Hello!!!
var per:String = "Bye";
function func2():Void (
trace("Hello!!!");
}

The point is that a function call can precede its definition. But it is impossible to read the value of a variable above its definition line. Such duality very often leads to confusion and mistakes. For example, if you call function B() from function A(), which uses the variable per declared between them, then activating A() above the definition of per will lead to ambiguity:

Function A():Void (
IN();
}
A(); // Outputs: undefined
var par:String = "Hello";
A(); // Outputs: Hello (the call is located below the variable definition)
function B():Void (
trace(par);
}

ActionScript is not a strict language when it comes to declaring variables. So, if you try to assign a value to a non-existent variable, the interpreter, after checking the appropriate scope chain, will simply automatically create it:

My_var = null; // The result of executing such a recording is mostly
// cases are similar to var my_var=null;

Automatic variable creation is not a common norm: in most universal languages programming, the appearance of an unknown identifier causes an error. In ActionScript, the use of var is not mandatory, but it is recommended. And there are good reasons for this:

Defining variables explicitly makes the script clearer, making it easier to debug and rework.

By creating a variable using var, you ensure that it does not simply override a variable of the same name that belongs to an overlying scope (this is important in the case of local function variables).

The var keyword allows variables to be strongly typed. If you try to set the type of a variable without var, compilation will fail.

This section concerns:
  • Platforms: Solaris SPARC, Red Hat Linux, SUSE Linux, Oracle Linux, Windows 10, Windows 8, Windows 7, Vista, Windows XP, Mac OS X

The instructions on this page are intended only for experienced users and system administrators.


General information

  • Variable PATH is a system variable that operating system used to find the desired executable objects in the command line or terminal window.
  • System variable PATH can be set using system utility in the Windows Control Panel or using a command launch file Linux shell and Solaris.
  • On computers running Windows or Mac OS X making changes to the system PATH variable usually not required.

Windows

Windows 10 and Windows 8
  1. In the "Search" line, search for: System (Control Panel)
  2. Click on the link.
  3. Click Environment Variables. In the section Environment Variables Change
  4. In the window (or New system variable OK OK.
Windows 7
  1. On the desktop right click click on the icon Computer.
  2. IN context menu select Properties.
  3. Click on the link Additional options systems.
  4. Click Environment Variables. In the section Environment Variables select the PATH environment variable. Click Change. If the PATH variable does not exist, click Create.
  5. In the window Changing a system variable(or New system variable) specify the value of the PATH environment variable. Click OK. Close the rest open windows, pressing OK.
  6. Reopen the command prompt window and run the java code.
Windows XP
  1. Click Start, select Control Panel, double click on System and select a tab Additionally.
  2. Click Environment Variables. In the section Environment Variables select the PATH environment variable. Click Change. If the PATH variable does not exist, click Create.
  3. In the window Changing a system variable(or New system variable) specify the value of the PATH environment variable. Click OK. Close other open windows by clicking OK.
  4. Reopen the command prompt window and run the java code.

Mac OS X

To run another version of Java, provide the full path or use the java_home tool:

% /usr/libexec/java_home -v 1.8.0_73 --exec javac -version

Solaris and Linux

  1. To find out if the path is configured correctly:
    In terminal windows, enter:
    % java -version
    The version of the java tool will be displayed if it cannot be found. If the version is outdated or an error appears java: command not found, then the path is set incorrectly.
  2. Determine which executable java version is the first one found in the variable PATH
    In a terminal window, enter:
    % which java
Final path setup

To set the path permanently, configure it in the startup file.
Note. Instructions are provided for the two most popular shells on Linux and Solaris. If you are using other shells, see the tutorial on setting the PATH variable.

Bash shell

Edit the startup file (~/.bashrc)

  1. Change a variable PATH variable
    PATH=/usr/local/jdk1.8.0/bin:$PATH
    export PATH
  2. Download the startup file
    %. /.profile

  3. % java -version
C shell (csh)

Edit the startup file (~/.cshrc)

  1. Set the path
    set path=(/usr/local/jdk1.8.0/bin $path)
  2. Save changes and close window
  3. Download the startup file
    % source ~/.cshrc
  4. Make sure the path is set by repeating the java command
    % java -version