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. 高德地图API编译警告

    版本: V2.1.1 警告内容: (null): warning: (i386) /Users/xiaominghan/Desktop/autonavi/MAMapKit_3D_r923_201310 ...

  2. [Leetcode][JAVA] Interleaving String

    Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = ...

  3. 小游戏runpig总结

    前几天写了一个JavaScript小游戏,大概是这样的 demo:strongfanfan.top/RunPig  源代码:www.github.com/strongfanfan/RunPig 画风简 ...

  4. python 延迟绑定

    def multipliers(n): funcs = [] for i in range(n): def f(x): return x * i funcs.append(f) return func ...

  5. Java中if语句,嵌套使用 一道面试题

    偶然看到这道题,起初还迷糊了,特此记录 int a = 100;if(a < 100) if(a < 200){ System.out.println("a < 200&q ...

  6. Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds问题

    错误:Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds. If the server requi ...

  7. 读bootstrap2.3.2有感2

    排版: Bootstrap定义的全局 font-size 是 14px,line-height 是 20px.这些样式应用到了 <body> 和所有的段落上.另外,对 <p> ...

  8. PHP 计算每个月的最后一天

    主要用到了 PHP 的 date() 函数和 mktime() 函数. date() 函数的 format 参数用到了选项 t,它表示某个月总共有多少天,数值范围为28-31. mktime() 函数 ...

  9. python发邮件实现Redis通知功能

    # -*- coding:utf-8 -*- import smtplib #import os from email.mime.text import MIMEText from email.mim ...

  10. Transactional replication-如何跳过一个事务

    在transactional replication, 经常会遇到数据同步延迟的情况.有时候这些延迟是由于在publication中执行了一个更新,例如update ta set col=? Wher ...