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 "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /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 tomcat\bin, 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:\Users\jwei>java -classpath E:\Projects\Java\workspace\PackageTest\bin test.Test

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

2.) E:\Projects\Java\workspace\PackageTest\bin>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:\Projects\Java\workspace\DBTest\bin>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)

 

 

posted on 2014-08-07 21:34  weihongji  阅读(317)  评论(0编辑  收藏  举报

导航