zoukankan      html  css  js  c++  java
  • Java environment variables and their functionality

    Concrete Operating 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 FilesJavajdk1.6.0_21
    2. PATH=%JAVA_HOME%in;%JAVA_HOME%jrein
    3. CLASSPATH=.;%JAVA_HOME%libdt.jar;%JAVA_HOME%libtools.jar

      

    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 jdkin and jdkjrein directory have been added in to the PATH env variable.

    E.g. "C:Program FilesJavajdk1.6.0_21in;C:Program FilesJavajdk1.6.0_21jrein", 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 jdklibdt.jar and jdklib ools.jar including the default classes JVM will use.

    E.g. ".;C:Program FilesJavajdk1.6.0_21libdt.jar;C:Program FilesJavajdk1.6.0_21libtools.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 FilesJavajdk1.6.0_21".


    For Tomcat web app deploying, the eclipse's export may cause one tiny issue in MacBook Pro:

    It's better NOT to choose "Optimize for a specific server runtime" item, which may cause the 404 error in Tomcat server.


    Eclipse的项目文件夹和workspace文件夹

    在迁入代码的时候,特别是从以前的SVN系统,分辨Eclipse项目和Eclipse的workspace是一件让人气恼的事情。一般来讲,版本控制下的项目,都是一个个的Eclipse项目。而识别它是Eclipse项目根目录的依据是看“.myeclipse.settings”文件夹是否存在。

    你还不可以直接使用这个项目,必须在你本地机器上的一个workspace中。

    一个让人头痛的问题是,很容易把项目的根目录(也就是.myeclipse所在的文件夹,例如把它命名为ProjectRoot)一并当做workspace去使用。这只会造成整个项目的编译失败。你的ProjectRoot文件夹,必须放在workspace文件夹里面

    而识别workspace根目录的依据是看“.metadata”文件夹是否存在。

  • 相关阅读:
    python 基础到字符串学习
    Newtonsoft.Json 获取匿名类数据
    Abp Wcf结合使用问题
    Ef Migration 操作出现SQLEXPRESS
    No context type was found in the assembly 'xxx.xxxx'. CodeFirst Ef错误
    Ef Code First 发生”provider: SQL Network Interfaces, error: 26
    ef 多条数据插入处理方案(据说还有更好的)
    记录一次 HttpWebRequest 尝试自动重定向太多 错误
    NetCore 下使用RSA加密,解密;并且前端使用jsencrypt.js实现Rsa相关方法。
    The specified framework version '2.0' could not be parsed 错误处理
  • 原文地址:https://www.cnblogs.com/kid551/p/4788619.html
Copyright © 2011-2022 走看看