Understanding logic in CaseInsensitiveComparator

From Unicode Technical Standard: In addition, because of the vagaries of natural language, there are situations where two different Unicode characters have the same uppercase or lowercase So, it’s not enough to compare only uppercase of two characters, because they may have different uppercase and same lowercase Simple brute force check gives some results. Check … Read more

How to set classpath when I use javax.tools.JavaCompiler compile the source?

The javax.tools.JavaCompiler#getTask() method takes an options parameter that allows to set compiler options. The following message describes an easy way to set them in order to access the calling program’s classpath: You need to configure the standard java file manager to know about the jar files(s) – you use the compiler options argument to do … Read more

How to define a relative path in java

Try something like this String filePath = new File(“”).getAbsolutePath(); filePath.concat(“path to the property file”); So your new file points to the path where it is created, usually your project home folder. [EDIT] As @cmc said, String basePath = new File(“”).getAbsolutePath(); System.out.println(basePath); String path = new File(“src/main/resources/conf.properties”) .getAbsolutePath(); System.out.println(path); Both give the same value.