Skip to main content

Java FAQ

javac 乱码

强制使用 UTF-8

javac -J-Dfile.encoding=UTF-8

环境变量

  • JAVA_TOOL_OPTIONS
    • java, javac, jar 会用
    • 例如 -agentlib:hprof
    • JVMTI 定义
  • _JAVA_OPTIONS
    • 类似 JAVA_TOOL_OPTIONS,但优先级更高
    • 针对 Hotspot
  • JAVA_OPTS
    • 由其他工具使用
    • java 不用
  • JDK_JAVA_OPTIONS
    • jdk9+
    • 类似 JAVA_TOOL_OPTIONS,但只有 java 会用
    • java
  • JAVA_HOME

Property

file.encoding=UTF-8
user.language=en
user.country=US
user.variant=
java.io.tmpdir=
javax.net.ssl.keyStore=
javax.net.ssl.keyStorePassword=
javax.net.ssl.keyStoreType=
javax.net.ssl.trustStore=
javax.net.ssl.trustStorePassword=
javax.net.ssl.trustStoreType=
com.sun.management.jmxremote=

选择 JUL 类逻辑

Why is generic of a return type erased when there is an unchecked conversion of a method parameter in Java 8?

Collection http://fastutil.di.unimi.it/ http://pcollections.org/ https://github.com/hrldcpr/pcollections

https://mvnrepository.com/artifact/org.eclipse.collections/eclipse-collections https://github.com/eclipse/eclipse-collections

http://java-performance.info/hashmap-overview-jdk-fastutil-goldman-sachs-hppc-koloboke-trove-january-2015/

https://mvnrepository.com/open-source/collections

<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>hppc</artifactId>
<version>0.8.1</version>
</dependency>

https://github.com/carrotsearch/hppc

Proxy performance

https://stackoverflow.com/q/1856242/1870054

deploy

  • -Dspring.profiles.active=development
  • SPRING_PROFILES_ACTIVE