Explanations of Functionalities:

1. PATH env variable

It is used to search the command directory when we use the console type commands. We only can use the javac and java command anywhere after the jdk\bin and jdk\jre\bin directory have been added in to the PATH env variable.

E.g. "C:\Program Files\Java\jdk1.6.0_21\bin;C:\Program Files\Java\jdk1.6.0_21\jre\bin", the ';' is the separator between env variables.

2. CLASSPATH env variable

It is used to search the known classes, which include the default classes used by JVM and the current classes we created. Thus we add '.' directory including the classes in current directory, and the jdk\lib\dt.jar and jdk\lib\tools.jar including the default classes JVM will use.

E.g. ".;C:\Program Files\Java\jdk1.6.0_21\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_21\lib\tools.jar".

3. JAVA_HOME env variable

It is used to indicate the directory of jdk. Many softwares like Eclipse, NetBeans, Tomcat will use this env variable to execute jdk.

E.g, "C:\Program Files\Java\jdk1.6.0_21".

Concrete Steps:

As all the env variables will involve the directory of jdk, we can set the JAVA_HOME first. Then we can use the %JAVA_HOME% make other env variables setting simple.

1. JAVA_HOME=C:\Program Files\Java\jdk1.6.0_21

2. PATH=%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin

3. CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar

.

Java environment variables and their functionality的更多相关文章

  1. How to set JAVA environment variables in Linux or CentOS

    How to set JAVA environment variables JAVA_HOME and PATH in Linux After installing new java (jdk or ...

  2. Java Environment Setting

    As a non-Java developer, I am quit stuck in Java environment setting because I am not familiar with ...

  3. CVE: 2014-6271、CVE: 2014-7169 Bash Specially-crafted Environment Variables Code Injection Vulnerability Analysis

    目录 . 漏洞的起因 . 漏洞原理分析 . 漏洞的影响范围 . 漏洞的利用场景 . 漏洞的POC.测试方法 . 漏洞的修复Patch情况 . 如何避免此类漏洞继续出现 1. 漏洞的起因 为了理解这个漏 ...

  4. Debian Environment Variables

    原文:EnvironmentVariables General Environment variables are named strings available to all application ...

  5. How to keep Environment Variables when Using SUDO

    The trick is to add environment variables to sudoers file via sudo visudo command and add these line ...

  6. Environment Variables

    https://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx Every process has an ...

  7. [Whole Web, Nods.js, PM2] Passing environment variables to node.js using pm2

    learn how to pass environment variables to your node.js app using the pm2 config file. This is usefu ...

  8. List environment variables from Command Prompt

    Request: List the environment variables from Command Promt To list one varibales , the syntax is lik ...

  9. [NPM] Execute npx commands with $npm_ Environment Variables

    We will incorporate npm specific environment variables when executing various npx commands. In our e ...

随机推荐

  1. HTTP1.1初识

    Http(超文本传输协议)是一个基于请求与响应模式的.无状态的.应用层的协议. Http1.1版中,有一个持续连接(Persistent Connections)机制,其作为Http1.1中建立连接的 ...

  2. sqlserver和oracle的递归查询

    1.sqlserver递归查询方式 CTE: if OBJECT_ID('tb','N') is not null   drop table tb;     create table tb(id va ...

  3. 让fetch也可以timeout

    原生的HTML5 API fetch并不支持timeout属性,习惯了jQuery的ajax配置的同学,如果一时在fetch找不到配置timeout的地方,也许会很纠结.fetch 的配置 API 如 ...

  4. P1906联合权值

    描述 无向连通图 G 有 n 个点,n-1 条边.点从 1 到 n 依次编号,编号为 i 的点的权值为 WiWi, 每条边的长度均为 1.图上两点(u, v)的距离定义为 u 点到 v 点的最短距离. ...

  5. [Leetcode][JAVA] Convert Sorted Array to Binary Search Tree && Convert Sorted List to Binary Search Tree

    Convert Sorted Array to Binary Search Tree Given an array where elements are sorted in ascending ord ...

  6. java调用Linux命令报错:java.io.IOException: Cannot run program "ps": CreateProcess error=2, ?????????

    在idea里面,java代码:Runtime.getRuntime().exec("ps -aux") 是因为默认是用windows平台运行了,所以报错,得改成调用Linux平台运 ...

  7. .NET环境下上传和下载Word文件

    一.上传Word文档或者其他文档 1.简单地上传文件的web服务方法如下 [WebMethod] public void UploadFile() { using (TransactionScope ...

  8. SQLSERVER中如何忽略索引提示

    SQLSERVER中如何忽略索引提示 当我们想让某条查询语句利用某个索引的时候,我们一般会在查询语句里加索引提示,就像这样 当在生产环境里面,由于这个索引提示的原因,优化器一般不会再去考虑其他的索引, ...

  9. Orchard Application Host

    https://orchardapphost.codeplex.com/ 近一步将Orchard框架发扬光大,还可以用来作为非Web应用的框架,如控制台程序,同时使用到Orchard框架的特性: 1. ...

  10. 【腾讯Bugly干货分享】iOS黑客技术大揭秘

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/5791da152168f2690e72daa4 “8小时内拼工作,8小时外拼成长 ...