Java environment variables and their functionality
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的更多相关文章
- 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 ...
- Java Environment Setting
As a non-Java developer, I am quit stuck in Java environment setting because I am not familiar with ...
- CVE: 2014-6271、CVE: 2014-7169 Bash Specially-crafted Environment Variables Code Injection Vulnerability Analysis
目录 . 漏洞的起因 . 漏洞原理分析 . 漏洞的影响范围 . 漏洞的利用场景 . 漏洞的POC.测试方法 . 漏洞的修复Patch情况 . 如何避免此类漏洞继续出现 1. 漏洞的起因 为了理解这个漏 ...
- Debian Environment Variables
原文:EnvironmentVariables General Environment variables are named strings available to all application ...
- 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 ...
- Environment Variables
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx Every process has an ...
- [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 ...
- List environment variables from Command Prompt
Request: List the environment variables from Command Promt To list one varibales , the syntax is lik ...
- [NPM] Execute npx commands with $npm_ Environment Variables
We will incorporate npm specific environment variables when executing various npx commands. In our e ...
随机推荐
- 算法入门笔记------------Day1
1.C语言使用%d显示float值,不会把float值转换为近似的int值,而是显示垃圾值,使用%f显示int值,也不会把该int值转换为浮点值 2.三位数反转:输入一个三位数,分离它的百位,十位和个 ...
- hdu 1394 Minimum Inversion Number(树状数组)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394 题意:给你一个0 — n-1的排列,对于这个排列你可以将第一个元素放到最后一个,问你可能得到的最 ...
- Cookie的设置与获取
- 关于MFC文本框输入内容的获取 与 设置文本框的内容
八月要开始做界面了<( ̄︶ ̄)/,然而目前只会用MFC╮(╯▽╰)╭ 好吧,言归正传,设置好文本框后,要获取用户输入的内容,可以用: GetDlgItemText() ; 这个函数有两个参数,第 ...
- mysql 索引问题
转自http://www.blogjava.net/happyenjoylife/archive/2011/12/17/366639.html mysql innodb存储与索引的总结 Innodb存 ...
- php 正则
1.中括号 [0-9]匹配0-9 [a-z]匹配a-z小写字母 [A-Z]匹配A-Z大写字母 [a-zA-Z]匹配所有大小写字母 可以使用ascii来制定更多 2.量词 p+匹配至少一个含p的字符串 ...
- centos 6.X minimal 系列最小化安装完成后,安装mono和jexus过程小记录
在使用虚拟机安装minimal版centos运行mono+jexus的时候,遇到了一些坑,记录一下,比如虚拟机访问不了网络,没wget命令没开放80端口,等等小问题,其他网上教程已经有mono+jex ...
- 口水话 闭包中this的指向
前言:高程这本书真是神奇,每复习一遍,都会有新的收获.话说我看书有个习惯,要是看得似懂非懂的地方就喜欢打个“?”.这次看到高程第七章“函数表达式”关于闭包与this对象的部分,发现已经积攒了2个问号了 ...
- STL练习题续
//zjnu 1399 //sort 数组可用//vector sort(vector) #include<iostream> #include<algorithm> usin ...
- HTML5-链接
链接:外部,图片,内部 <!DOCTYPE html> <html> <head lang="en"> <meta charset=&qu ...