java-7

JDK 7 with Android SDK R13 in windows 7

妖精的绣舞 提交于 2019-12-18 07:41:34
问题 I want to use JDK 7 64bit for android development. But in system requirement of android development it is said that it need's "JDK 5 or JDK 6". Is there any problem if i want to use latest JDK 64bit with latest android SDK and new eclipse IDE 64bit? Note: 回答1: JDK 7 64-bit works without issue on Windows7 64-bit, however you will probably need to download both the 32-bit and 64-bit versions of the SDK. I'm not sure why they haven't solved this issue but the fix works, and JDK 7 works fine with

Forcing the use of english in JDK7 tools

╄→гoц情女王★ 提交于 2019-12-18 05:54:29
问题 I just installed JDK7 on a german Windows machine and the first thing I noticed is that unlike JDK6 it takes after the OS and some messages (e.g., the help messages from the tools but not error messages from the compiler) are in german. How can I force it to use english everywhere? AFAIK the installer isn't language-specific and all the messages during installation were in english. 回答1: You mean javac? Try setting -J-Duser.language=en argument. See this post: Passing "-J-Duser.language" into

Java 7 Date/Time API [closed]

╄→гoц情女王★ 提交于 2019-12-18 05:43:19
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I notice that a snapshot of the Java 7 API has been up on java.sun.com for some time, but I only just had a look through it just now, looking

lower case of turkish character dotted i

江枫思渺然 提交于 2019-12-18 05:01:41
问题 In Java 6, System.out.println(String.valueOf('\u0130').toLowerCase()); prints i ( u0069 ), but in Java 7 it prints i with double dots ( u0069 u0307 ). I understand it is a Turkish character, but how do I make Java 7 print the same output as v6 using this code? System.out.println(inputText.toLowerCase()); Also make sure that the code can handle international text without hardcoding the toLowerCase function to use only Turkish locale. 回答1: There is a quite detailed blog post about this i

Wrap long words in JTextPane (Java 7)

≯℡__Kan透↙ 提交于 2019-12-18 03:17:09
问题 In all versions of Java up to 6, the default behaviour of a JTextPane put inside a JScrollPane was: wrap lines at word boundaries if possible. If not, then wrap them anyway. In JDK 7, the default behaviour seems to be: wrap lines at word boundaries if possible. If not, just expand the width of the JTextPane (never wrap long words). It is easy to reproduce this, here is a SSCCE: public class WrappingTest extends JFrame { public static void main ( String[] args ) { new WrappingTest(); } public

Get files in a directory sorted by last modified? [duplicate]

本小妞迷上赌 提交于 2019-12-18 03:09:24
问题 This question already has answers here : Best way to list files in Java, sorted by Date Modified? (16 answers) Closed 3 years ago . In Java 7 with the new I/O APIs, is there an easy way to list a directory's content by last modified date? Basically I only need to get the file the wasn't modified for the longest time (sort by last modified ascending, take first filename). 回答1: There's no real "easy way" to do it, but it is possible: List<Path> files = new ArrayList<>(); try(DirectoryStream

Get files in a directory sorted by last modified? [duplicate]

无人久伴 提交于 2019-12-18 03:09:05
问题 This question already has answers here : Best way to list files in Java, sorted by Date Modified? (16 answers) Closed 3 years ago . In Java 7 with the new I/O APIs, is there an easy way to list a directory's content by last modified date? Basically I only need to get the file the wasn't modified for the longest time (sort by last modified ascending, take first filename). 回答1: There's no real "easy way" to do it, but it is possible: List<Path> files = new ArrayList<>(); try(DirectoryStream

Why switch on String compiles into two switches

跟風遠走 提交于 2019-12-18 03:05:29
问题 I read JVM specification on compiling switches and became interested in how switch statement on String is compiled. Here is the test method I examined (JDK1.7.0_40): static int test(String i) { switch (i) { case "a": return -100; case "45b": return 1; case "c": return 2; default: return -1; } } I expect this method to be compiled into simple lookupswitch on hashCode of string, but suddenly static int test(java.lang.String); Code: 0: aload_0 1: astore_1 2: iconst_m1 3: istore_2 4: aload_1 5:

How to access a sub-file/folder in Java 7 java.nio.file.Path?

China☆狼群 提交于 2019-12-17 22:54:51
问题 Java 7 introduced java.nio.file.Path as a possible replacement for java.io.File. With File, when I access a file under a specific, I would do: File parent = new File("c:\\tmp"); File child = new File(parent, "child"); // this accesses c:\tmp\child What's the way to do this with Path? I supposed this will work: Path parent = Paths.get("c:\\tmp"); Path child = Paths.get(parent.toString(), "child"); But calling parent.toString() seems ugly. Is there a better way? 回答1: Use the resolve method on

Java access files in jar causes java.nio.file.FileSystemNotFoundException

我只是一个虾纸丫 提交于 2019-12-17 22:31:40
问题 While trying to copy some files in my jar file to a temp directory with my java app, the following exception is thrown: java.nio.file.FileSystemNotFoundException at com.sun.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:171) at com.sun.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:157) at java.nio.file.Paths.get(Unknown Source) at com.sora.util.walltoggle.pro.WebViewPresentation.setupTempFiles(WebViewPresentation.java:83) .... and this is a small