Обнаружил, что если в Ubuntu 13.04 отключить сглаживание шрифтов и выбрать по умолчанию, например, Arial, то система совершенно нормально всё отображает! Наконец-то! Может так и раньше можно было сделать, но я только сейчас это нашёл. Нормальные шрифты как в винде.
Также можно сделать подобное в PHPStrom (IDEA), добавив (заменив) следующие строчки в файлах phpstorm64.vmoptions и phpstorm.vmoptions:
В каталоге /opt/phpstorm/bin или том, где он стоит.
Кроме того, есть другой путь для улучшения отображения шрифтов в Java-based приложениях: http://nixmash.com/php/better-looking-intellij-idea-fonts-in-linux-mint/
Обратите внимание на интересную опцию: -Dsun.java2d.xrender=true
// From:
// http://blog.efftinge.de/2008/10/multi-line-string-literals-in-java.html
// Takes a comment (/**/) and turns everything inside the comment to a string
// that is returned from S()
public static String S()
{
StackTraceElement element = new RuntimeException().getStackTrace()[1];
String name = element.getClassName().replace('.', '/') + ".java";
StringBuilder sb = new StringBuilder();
String line = null;
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream in = classLoader.getResourceAsStream(name);
String s = convertStreamToString(in, element.getLineNumber());
return s.substring(s.indexOf("/*") + 2, s.indexOf("*/"));
}
// From http://www.kodejava.org/examples/266.html
private static String convertStreamToString(InputStream is, int lineNum)
{
/*
* To convert the InputStream to String we use the BufferedReader.readLine()
* method. We iterate until the BufferedReader return null which means
* there's no more data to read. Each line will appended to a StringBuilder
* and returned as String.
*/
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
int i = 1;
try
{
while ((line = reader.readLine()) != null)
{
if (i++ >= lineNum)
{
sb.append(line + "\n");
}
}
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
try
{
is.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
return sb.toString();
}
public static void main(String[] args) throws Exception
{
String s = S(/*
Wow, we finally have
multiline strings in
Java! HOOO!
*/);
System.out.println(s);
}
Ещё одна ссылка в блокнотик: http://habrahabr.ru/post/143113/
Там описаны разные простые способы установки Oracle JDK 7 в Ubuntu 12.04.
Самым простым способом мне показался такой.
Добавляем новый репозиторий:
# add-apt-repository ppa:upubuntu-com/java