java-7

Apple Retina Display Support in Java JDK 1.7 for AWT / Swing

风格不统一 提交于 2019-11-28 21:13:36
I just became aware that AWT / Swing under Java JDK 1.7 (as of JDK 7u15) does not support Retina displays on Apple Macbook Pros. Netbeans, for example, is nearly unbearable to use for more than a few minutes running on a Retina display and using JDK 1.7. This has been somewhat addressed in a StackExchange question here , and quoting one specific post: Apple's Java 6 JRE will support HiDPI, however it is not currently supported by Oracle's Java 7 JRE. It also doesn't work under the latest dev builds of Java 8. Swing and JavaFX apps are blurry on a Retinia MacBook. This is why IntelliJ still

Does ADT support Java 7 API [closed]

。_饼干妹妹 提交于 2019-11-28 21:06:07
Do Android Developers Tools support JAVA 7 API up to this date? I'm trying to build an Android app using JAVA 7 and I was wondering about this thing. While you can write code in Java 7, the Android Systems that run it only support upto Java 6, so 7 features like switch-case on Strings fail. As of Build tools 19 , Java 7 is now supported. No, the android documentation is pretty clear about this. Only Java 6. Also, be sure to download the Oracle JDK 6 (the Java Runtime is not sufficient). 来源: https://stackoverflow.com/questions/15848332/does-adt-support-java-7-api

Is there something like LINQ for Java? [closed]

吃可爱长大的小学妹 提交于 2019-11-28 18:17:46
Started to learn LINQ with C#. Especially LINQ to Objects and LINQ to XML. I really enjoy the power of LINQ. I learned that there is something called JLINQ a Jscript implementation. Also (as Catbert posted) Scala will have LINQ Do you know if LINQ or something similar will be a part of Java 7? Update: Interesting post from 2008 - LINQ for Java tool catbert Look at Scala , which is powerful functional programming language, but is similar to Java and runs on Java platform. In Scala it is possible to use essentially the same code constructs as in LINQ, albeit without special query comprehensions

How should I use AsynchronousServerSocketChannel for accepting connections?

血红的双手。 提交于 2019-11-28 18:04:03
问题 I would like to write an asynchronous server using Java 7 and NIO 2. But how should I use AsynchronousServerSocketChannel? E.g. if I start with: final AsynchronousServerSocketChannel server = AsynchronousServerSocketChannel.open().bind( new InetSocketAddress(port)); Then when I do server.accept() , the program terminates because that call is asynchronous . And if I put that code in an infinite loop, an AcceptPendingException is thrown. Any suggestions on how to write a simple asynchronous

How to use -XX:+UnlockDiagnosticVMOptions -XX:CompileCommand=print option with JVM HotSpot

好久不见. 提交于 2019-11-28 17:56:42
I 'm trying to use -XX:+UnlockDiagnosticVMOptions -XX:CompileCommand=print,*MyClass.myMethod command lines as described in this post . It seems thats it's available with open-jdk ( https://wikis.oracle.com/display/HotSpotInternals/PrintAssembly ). How can I use those options (or similar equivalents) with oracle JDK7 and the JVM HotSpot? These instructions apply to Linux (Ubuntu 10.04.4 LTS), but should be applicable for your OS. After downloading Oracle JDK 7u3 and appropriately setting your JAVA_HOME and PATH environment variables, execute the following to check available options: java -XX:

Some basic questions about MethodHandle API

守給你的承諾、 提交于 2019-11-28 17:17:45
How can I obtain all declared method through MethodHandles.lookup() ? How can I obtain all declared fields? What is difference betweeen MethodHandle.invoke() , MethodHandle.invokeExact() and MethodHandle.invokeWithArguments() Also, I will be appreciate for tutorial about using MethodHandle API for Java devloper . I emphasize, I am programming on statically typed language plain old Java and I am not JVM developer, particularly I am not interesting with whole byte-code crap (invokedynamic). I want to figure out how can I use this new API instead of Java Core API. EDITED-2: @Glen Best below

What means “javax.net.ssl.SSLHandshakeException: server certificate change is restrictedduring renegotiation” and how to prevent it?

梦想与她 提交于 2019-11-28 16:50:27
We use Oracle jdk 1.7.0_71 and Tomcat 7.0.55. Unfortunately we started to get the following exception during SSL connection between servers: javax.net.ssl.SSLHandshakeException: server certificate change is restrictedduring renegotiation What it means? How to prevent it? The exception is disappeared after the Tomcat restart. The full stack: Caused by: javax.net.ssl.SSLHandshakeException: server certificate change is restrictedduring renegotiation at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) ~[?:1.7.0_71] at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884) ~[?:1.7.0

How serious is the Java7 “Solr/Lucene” bug?

白昼怎懂夜的黑 提交于 2019-11-28 16:18:17
Apparently Java7 has some nasty bug regarding loop optimization: Google search . From the reports and bug descriptions I find it hard to judge how significant this bug is (unless you use Solr or Lucene). What I'd like to know: How likely is it that my (any) program is affected? Is the bug deterministic enough that normal testing will catch it? Note: I can't make users of my program use -XX:-UseLoopPredicate to avoid the problem. The problem with any hotspot bugs, is that you need to reach the compilation threshold (e.g. 10000) before it can get you: so if your unit tests are "trivial", you

Why is StringBuilder#append(int) faster in Java 7 than in Java 8?

血红的双手。 提交于 2019-11-28 15:24:50
While investigating for a little debate w.r.t. using "" + n and Integer.toString(int) to convert an integer primitive to a string I wrote this JMH microbenchmark: @Fork(1) @OutputTimeUnit(TimeUnit.MILLISECONDS) @State(Scope.Benchmark) public class IntStr { protected int counter; @GenerateMicroBenchmark public String integerToString() { return Integer.toString(this.counter++); } @GenerateMicroBenchmark public String stringBuilder0() { return new StringBuilder().append(this.counter++).toString(); } @GenerateMicroBenchmark public String stringBuilder1() { return new StringBuilder().append("")

java.lang.NoClassDefFoundError: sun/swing/plaf/synth/SynthUI

不问归期 提交于 2019-11-28 14:11:25
问题 I am using Seaglass Look and Feel for my Java Swings code. But I keep getting this error. Exception in thread "main" java.lang.NoClassDefFoundError: sun/swing/plaf/synth/SynthUI at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at