zoukankan      html  css  js  c++  java
  • EV: Java

    1. Forcing the use of English in JDK7 tools

    javac -J-Duser.language=en xxx.java

    java -Duser.language=en xxx

     

    Execute below in the Run command window:

    --------------------------------------------------

    REG ADD "HKLMSYSTEMCurrentControlSetControlSession ManagerEnvironment" /v JAVA_TOOL_OPTIONS /d -Duser.language=en /t REG_SZ /f

    Reference: http://stackoverflow.com/questions/6217297/forcing-the-use-of-english-in-jdk7-tools

    In java commond, run C:>java -Duser.language=en

    In tomcat, you can how two ways to set java language as English.

    Option 1: Create a setenv.bat file in tomcatin, enter the following line in it.

    set "JAVA_OPTS=%JAVA_OPTS% -Duser.language=en"

    Option 2: Create Windows environment variable JAVA_OPTS with value "-Duser.language=en"

    Reference:

        https://docs.oracle.com/cd/E40520_01/integrator.311/integrator_install/src/cli_ldi_server_config.html

        D:/tomcat/webapps/docs/RUNNING.txt

    In eclipse, add the following option below -vmargs in eclipse.ini

    -Duser.language=en

    Reference: https://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM

    2. Compile and run multiple classes

    1.) Navigate to the directory of files

    2.) mkdir bin

    3.) javac *.java -d bin

    4.) java -cp bin DogTestDrive

    4. >java [-options] class

    options are in front of class.

    example:

    1.) C:Usersjwei>java -classpath E:ProjectsJavaworkspacePackageTestin test.Test

    The main() class and referenced packages are all in a same parent folder.

    2.) E:ProjectsJavaworkspacePackageTestin>java -classpath .;pk test.Test

    Referenced packages are in a folder named pk which is in a same parent folder with the main() class.

    3.) E:ProjectsJavaworkspaceDBTestin>java -classpath .;sqljdbc42.jar Test 

    Referenced package is a jar file which is in the same class as Test.class.

    5. Language

    intVar.ToString() --> String.valueOf(intVar)

     

     

  • 相关阅读:
    C++ Primer 随笔 Chapter 2 变量和基本类型
    比较全面的gdb调试命令 (转载)
    open和fopen的区别(转)
    来了
    Function语义学之member function
    TCP/IP学习(四)TCP缓冲区大小及限制(转)
    TCP连接的建立和终止
    Data 语义学(2)
    Data 语义学(1)
    一个类到底有多大?
  • 原文地址:https://www.cnblogs.com/weihongji/p/java.html
Copyright © 2011-2022 走看看