java-7

Overriding single classes from rt.jar

喜欢而已 提交于 2019-11-30 18:01:05
问题 I'm looking for a neat way to override a class from the bootstrap class path, rt.jar . The reason is OpenJDK7 bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7104625 The fix for this bug is a trivial (see linked mailing list post) change to sun.awt.X11.XComponentPeer . So I was wondering if there is an easy way to override just this one affected class on my classpath, without having to repack/rebuild rt.jar (so the fix isn't lost on the next automatic update of OpenJDK). Ideally, it

jdk1.7's javac can't find javafx jar without -cp option

若如初见. 提交于 2019-11-30 17:52:35
I've read several questions on this site and elsewhere that indicate that when Oracle JDK7 is installed, it should not be necessary to specify the classpath to jfxrt.jar when the JDK is installed correctly . Unfortunately, my installation does not seem to be correct, but I cannot figure out what is wrong. I used the correct RPM for my Red Hat Enterprise Linux 6.2 Server and I'm able to build JavaFX apps in Eclipse when I added the jfxrt.jar to the External Jars. But when trying to compile and run from the command line, it does not find JavaFX classes unless I specify the -cp option to javac

Getting FileSystemException “A required privilege is not held by the client” using Files.createSymbolicLink in Play Framework

◇◆丶佛笑我妖孽 提交于 2019-11-30 17:16:24
I'm trying to use the new Java 7 Files.createSymbolicLink() method within Play! Framework, and I got the following exception: RuntimeException occured : java.nio.file.FileSystemException: c:\work\foo\bar: A required privilege is not held by the client. This is my first encounter with Java's permission model, so I understand what's going on, but don't yet know how to fix it (I'd like to give the Controllers more permissions). If anyone can answer here faster than I'll find the answer, me (and future readers) will be grateful. This isn't a problem with java permissions, but a problem with the

How do I use directory globbing in JDK7

匆匆过客 提交于 2019-11-30 17:14:49
I have been trying to use the new globbing feature in JDK7, starting from the documentation and examples I can get globs such as "glob:*.dat" to work with the Files.walkFileTree(startingDir, finder); example but I have been unable to get the "**" syntax working. I would like to be able to create something like: matcher = FileSystems.getDefault().getPathMatcher("glob:" + "foo/**/bar/*.dat"); and would be grateful for a simple example. I am using Windows 7. UPDATE: @Oleg and @JBNizet make it clear that the "/" syntax is OS-independent. Note that the Javadocs suggest that OS-dependent syntax is

Why is getWindow() not able to be resolved?

谁说胖子不能爱 提交于 2019-11-30 17:09:21
I can't resolve the getWindow(); method for some reason... import java.applet.Applet; import netscape.javascript.JSObject; public class Class466 { public static void method6020(Applet applet, String string, int i) throws Throwable { try { JSObject.getWindow(applet).eval(string); } catch (RuntimeException runtimeexception) { throw Class346.method4175(runtimeexception, new StringBuilder() .append("tf.a(").append(')').toString()); } } public static Object method6021(Applet applet, String string, short i) throws Throwable { try { return JSObject.getWindow(applet).call(string, null); } catch

Enhanced for loop compiling fine for JDK 8 but not 7

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 16:51:01
Consider the following code snippet, I stumpled upon after some refactoring, when checkin why the build server reported a broken build but it was fine in my IDE: List<String> text; ... for (String text : text) {...} So, the same name is used for the String and the List within the for-each. This is of course not very wise to do, but after following my nosiness before renaming it, I saw that the above code compiles fine with JDK 8, but gives the below error with JDK 7: error: for-each not applicable to expression type for (String text : text) { ^ required: array or java.lang.Iterable found:

jdk1.7's javac can't find javafx jar without -cp option

依然范特西╮ 提交于 2019-11-30 16:45:43
问题 I've read several questions on this site and elsewhere that indicate that when Oracle JDK7 is installed, it should not be necessary to specify the classpath to jfxrt.jar when the JDK is installed correctly . Unfortunately, my installation does not seem to be correct, but I cannot figure out what is wrong. I used the correct RPM for my Red Hat Enterprise Linux 6.2 Server and I'm able to build JavaFX apps in Eclipse when I added the jfxrt.jar to the External Jars. But when trying to compile and

Enhanced for loop compiling fine for JDK 8 but not 7

懵懂的女人 提交于 2019-11-30 16:36:58
问题 Consider the following code snippet, I stumpled upon after some refactoring, when checkin why the build server reported a broken build but it was fine in my IDE: List<String> text; ... for (String text : text) {...} So, the same name is used for the String and the List within the for-each. This is of course not very wise to do, but after following my nosiness before renaming it, I saw that the above code compiles fine with JDK 8, but gives the below error with JDK 7: error: for-each not

Java is backward compatible, but why we need to upgrade many libraries when we upgrade jdk from 1.6 to 1.8?

不想你离开。 提交于 2019-11-30 14:56:57
问题 Recently, we upgrade the Jdk version from 1.6 to 1.8 in one of my Java project. But there are some compilation or runtime errors, so I have to upgrade some libraries: gradle: 1.9 to 1.10 spring: 3.x to 4.x That because they are using some early versions of ASM, but which supports jdk 1.8 only from 5.x Java said it is backward compatible, but why the original versions of libraries can't work with jdk 1.8 directly? 回答1: Because ASM is a tool that operates on the Java byte-code. And the byte

Focus problems with JDK7 and native components

╄→尐↘猪︶ㄣ 提交于 2019-11-30 14:30:34
We have a swing application which embeds a IE ocx component via JNIWrapper. After switching from jdk6 to jdk7 we start noticing focus problems. When the embedded IE shows a web page with text fields (e.g. the google search page) than the trouble starts: The Browser 'catches' the focus, so u can start typing in the search text field. Every key typed goes to the IE ocx. But swing seems to ignore this focus change. Even if i change the focus to a swing text field (and swing shows the blinking input cursor), all typed keys goes to the IE ocx The only way to 'fix' the focus is to deacitvate and