java-7

How to run Eclipse Indigo on JDK 1.7 OSX

无人久伴 提交于 2019-12-03 02:28:39
With the recently OSX JDK 7 ea release from Oracle. How to run Eclipse Indigo ? I get the following error msg: $ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home $ java -version openjdk version "1.7.0-ea" OpenJDK Runtime Environment (build 1.7.0-ea-b211) OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode) $ /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse JavaVM: requested Java version ((null)) not available. Using Java at "" instead. JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib JavaVM FATAL: Failed to load the jvm

What is the difference between the Java 1.6 and 1.7 jarsigner

╄→гoц情女王★ 提交于 2019-12-03 01:51:33
Just noted that you can´t sign Android APKs with the Java 1.7 jarsigner. So I wonder why this is and what is the difference between the 1.6 and 1.7 signer? This is because the default digest algorithm for Java 1.7 is SHA-256 while for Java 1.6 it's SHA1withDSA . Java 1.6 Jarsigner docs Java 1.7 Jarsigner docs Yes you CAN use 1.7! It is very tricky to find info on the usage with 1.7, but once found it is reasonable simple: For keytool include -sigalg SHA1withDSA -keyalg DSA -keysize 1024 For jarsigner include -sigalg SHA1withDSA -digestalg SHA1 (1024 is the maximum and works, less might do the

Coldfusion 10 slower when using Java 1.7 compared to 1.6

大兔子大兔子 提交于 2019-12-03 01:34:20
I have a webservice running on Coldfusion 10 64bit . While investigating a memory leak I went to upgrade the JRE from 1.6 to 1.7 but noticed a significant performance hit. I had created a simple test webservice which on JRE 1.6 I could run easily at 5000 requests per minute as soon as I changed the JRE to 1.7 though this rate drops too 2000 or less per minute. Does anyone know of tuning settings or something I am missing. The preference is to use JRE 1.7 as it appears to have fixed the memory leak issue I was having. Running Server JRE: java version "1.7.0_51" Java(TM) SE Runtime Environment

Why does WatchService generate so many operations?

◇◆丶佛笑我妖孽 提交于 2019-12-03 01:22:23
import java.io.*; import java.nio.file.*; public class Tmp { public static void main(String [] args) throws IOException { int count = 0; Path path = Paths.get("C:\\tmp\\"); WatchService ws = null; try { ws = FileSystems.getDefault().newWatchService(); path.register(ws, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.OVERFLOW); } catch (IOException ioe) { ioe.printStackTrace(); } while(true) { WatchKey key = null; try { key = ws.take(); } catch(InterruptedException ie) { ie.printStackTrace(); } for

Java: int array initializes with nonzero elements

狂风中的少年 提交于 2019-12-03 00:31:26
问题 According to the JLS, an int array should be filled by zeros just after initialization. However, I am faced with a situation where it is not. Such a behavior occurs first in JDK 7u4 and also occurs in all later updates (I use 64-bit implementation). The following code throws exception: public static void main(String[] args) { int[] a; int n = 0; for (int i = 0; i < 100000000; ++i) { a = new int[10]; for (int f : a) if (f != 0) throw new RuntimeException("Array just after allocation: "+ Arrays

Where can I locate and browse JDK 7 source files? [closed]

喜欢而已 提交于 2019-12-02 23:23:02
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Can anyone direct me to where the jdk 7 source is hosted? This is the repository for OpenJDK As for Oracle's JDK7 , there are binaries and docs, but no source to browse. fouding.zheng The direct link is this . If you wonder how this link is got, follow this link , except that select "jdk7/jdk7-gate/jdk" instead of "jdk6/jdk6-gate/jdk" for jdk 7 sources. For Java source codes in JRE, this website is more useful than hgweb

Java validate date in yyyyMMddHHmmss

落花浮王杯 提交于 2019-12-02 22:44:42
问题 i want to validate the given date format as yyyyMMddHHmmss in java. Conditions: It should meet the format yyyyMMddHHmmss. It should validate the current date. It should validate hours which can be +3 hours or -3 hours variance with the current hour. If all three conditions are met, the Java method should return true. My current code only validates the yyyyMMddHHmmss format. My current code public class SO31132861 { public static void main(String[] args) { SimpleDateFormat df = new

Creating distinct list from existing list in Java 7 and 8?

主宰稳场 提交于 2019-12-02 22:28:04
If I have: List<Integer> listInts = { 1, 1, 3, 77, 2, 19, 77, 123, 14, 123... } in Java what is an efficient way of creating a List<Integer> listDistinctInts containing only the distinct values from listInts ? My immediate thought is to create a Set<Integer> setInts containing all the values from listInts then call List<Integer> listDistinctInts = new ArrayList<>(setInts); But this seems potentially inefficient - is there a better solution using Java 7? I'm not using Java 8, but I believe using it I could do something like this(?): List<Integer> listDistinctInts = listInts.stream().distinct()

How do I install JDK7 (Java 7) on Mac OS X 10.7.3? [closed]

自作多情 提交于 2019-12-02 20:55:30
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center . What is the link to install JDK7 (Java 7) on Mac OS X 10.7.3? What version does it install? Where does it install on my box? How do I use it? Download Java SE 7u4 from Oracle. (This is 64-bit only) This installs to /Library/Java/JavaVirtualMachines/1.7.0.jdk . However, when you run java -version it will still output 1.6 or some other

Java 7: Fork/Join Framework

耗尽温柔 提交于 2019-12-02 20:50:26
Can someone explain what Fork/Join is? Fork Join is a new framework that has an easier to use API for a parallel, divide and conquer algorithm. Say you have a long running task that, for this instance, has a complicated algorithm. You would want to fork the large tasks and now work on those two tasks. Now lets say that that those two tasks are still too big, you would fork each into two tasks (at this point there are four). You would continue this until each task is at an acceptable size and invoke the algorithm. It is important to know the invocation of each task is done in parallel. When the