java-7

Java Drag and drop on OS X reports Move instead of Copy

心已入冬 提交于 2019-12-07 12:33:26
问题 Update/status: Bug is reported to Oracle and currently still open/unresolved: https://bugs.openjdk.java.net/browse/JDK-8054325 I've found a strange bug, which only manifests itself on Java 7 and 8 on OS X, not in Java 6, neither on Java 7 Windows. Below is the extracted bug removing as much unneeded code as possible. It leaves us with a small table and a button, where we can drag the cell from the table on top of the button. In our production code we are using a TransferHandler that has COPY

Understand an gif is animated or not in JAVA

半世苍凉 提交于 2019-12-07 12:24:20
问题 I have a gif image and I would like to be able to detect whether the gif is an animated gif or not using JAVA. This question is about detection rather than displaying the gif. I see that MIME type of animated gif isn't different of static gif. How I can do it? 回答1: You need an ImageReader. if size is 1 its not animated, everything above is animated. Check this out: public Snippet() { File f = new File("test.gif"); ImageReader is = ImageIO.getImageReadersBySuffix("GIF").next();

Java 8 interface/class loader changes?

£可爱£侵袭症+ 提交于 2019-12-07 09:27:56
问题 I have found some difficult cautious between Java 1.7_51 and Java 1.8_20. The initial situation: One Interface: interface InterfaceA { public void doSomething(); } Two classes: public class ClassA implements InterfaceA { public void doSomething() { System.out.println("Hello World!"); } } public class ClassB { public static void main(String[] args) { ClassA a = new ClassA(); a.doSomething(); } } Next i have compiled the classes with (Java 1.8) -> javac *.java after the compiler finished i

How to fully qualify a class whose package name collides with a local member name?

旧时模样 提交于 2019-12-07 08:15:30
问题 OK, here's a very curious Java 7 language puzzle for the JLS specialists out there. The following piece of code won't compile, neither with javac nor with Eclipse: package com.example; public class X { public static X com = new X(); public void x() { System.out.println(com.example.X.com); // cannot find symbol ^^^^^^^ } } It appears as though the member com completely prevents access to the com.* packages from within X . This isn't thoroughly applied, however. The following works, for

Can we use jdk7 javac to compile code with java7 features into java6 bytecode

跟風遠走 提交于 2019-12-07 06:15:36
问题 I was considering if a java project could produce 2 jars: one for java7 and one for java6, yes, the source code might use some some java7 new features. so to generate the java6 jar, the command line would be like: javac -target 1.6 -bootclasspath jdk1.6.0\lib\rt.jar -extdirs "" MyApp.java Unfortunately, It simply emits an error: javac: target release 1.6 conflicts with default source release 1.7 According to this document, it should be possible for jdk6 vs jdk5, anybody knows why it doesn't

How can I use Java 7 with Eclipse Indigo 3.7.1

↘锁芯ラ 提交于 2019-12-07 05:41:31
问题 From what I understand Eclipse Indigo 3.7.1 should now have support for Java 7. I downloaded Eclipse 3.7.1. and JDK 1.7.0 and added JRE7 in the settings in Eclipse. Then I created a new project using JRE7 and wrote a short Java 7 program: public class Test7 { public static void main(String[] args) { String k = "Hello"; switch(k) { case "World": System.out.println("World Hello"); break; case "Hello": System.out.println("Hello World"); break; } } } But I get an error when I try to use a String

WebLogic 12c - Destination unreachable exception

流过昼夜 提交于 2019-12-07 04:51:37
问题 First, I had installed jdk 1.6.0_43 and oracle weblogic 12.1.1, I was successfully able to deploy my application. I then upgraded both my jdk (1.7.0_60) and weblogic (12.1.2), but was unable to deploy my application. Now, I downgraded my weblogic (12.1.1) but retained my jdk 1.7.0_60, but i was still not able to deploy my application successfully. In both the failure cases, I got the same error with the following message. Is there something with respect to java 7 I should be aware of? I tried

How to work with SVN 1.7 repositories using Netbeans 7.1?

落花浮王杯 提交于 2019-12-07 04:48:35
问题 When trying to update a subversion working copy from Netbeans, I get the following error svn: E175002: Unable to connect to a repository at URL 'https://svn.XXX.de/svn/[RepositoryName]' svn: E175002: OPTIONS of 'https://svn.XXX.de/svn/[RepositoryName]': Server certificate verification failed: issuer is not trusted (https://svn.XXX.de) Additionally I get a popup window saying SVN command returned with the following error: javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name I

Unsupported Class Version Error

馋奶兔 提交于 2019-12-07 01:40:31
问题 While trying to call an EJB made using NETbeans (using jdk1.7) from a client made using Eclipse IDE (using jdk1.6), I am getting following error- Exception in thread "main" java.lang.UnsupportedClassVersionError: stateless/TestEjbRemote : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass

1s Delay in HttpServer since Java 7

前提是你 提交于 2019-12-07 01:12:23
问题 We are using the internal HttpServer class in a project to exchange data between a client and a server over HTTP. As we switched to Java 7, we realized a delay in the delivery of the results. We could reduce the problem to the following sample: Class EchoServer creates the context /echo which simply returns the current date and the request URI upon each request. This service is then invoked by a client in a loop. import java.io.IOException; import java.io.OutputStream; import java.net