java-7

Android Studio stuck on loading screen

前提是你 提交于 2019-12-04 09:54:39
Every time I run Android Studio, this loading screen pops up, but Android Studio stays here and doesn't load. It's like this following picture except that the loading bar is loaded all the way but stuck there. I am running Windows 10. I have tried many things, including setting the system variables JDK_HOME to where my JDK is located and the same for JAVA_HOME . I have also set a path. I ran as admin many times and let AS through a firewall. I have also restarted and reinstalled countless times. The version of AS is 2.0 , and I am running the latest versions of Java. Any help? Open file

Encoding issue on filename with Java 7 on OSX with jnlp/webstart

Deadly 提交于 2019-12-04 09:18:07
问题 I have this problem that has been dropped on me, and have been a couple of days of unsuccessful searches and workaround attempts. I have now an internal java swing program distributed by jnlp/webstart, on osx and windows computers, that, among other things, downloads some files from WebDav. Recently, on a test machine with OSX 10.8 and Java 7, filenames and directory names with accented characters started having those replaced by question marks. No problem on OSX with versions of Java before

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

爱⌒轻易说出口 提交于 2019-12-04 08:57:52
问题 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

Why does WatchService generate so many operations?

人盡茶涼 提交于 2019-12-04 08:55:56
问题 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

Java 7: What charset shall I use when calling Files.newBufferedReader?

≡放荡痞女 提交于 2019-12-04 08:44:56
In previous versions of Java, I would read a file by creating a buffered reader like this: BufferedReader in = new BufferedReader(new FileReader("file.txt")); In Java 7, I would like to use Files.newBufferedReader , but I need to pass in a charset as well. For example: BufferedReader in = Files.newBufferedReader(Paths.get("file.txt"), Charset.forName("US-ASCII")); Previously, I did not have to worry about charsets when reading plain text files. What charset shall I use? Do you know what charset was used by default in previous versions of Java? I simply want to be able to find and replace the

Java 7: Fork/Join Framework

让人想犯罪 __ 提交于 2019-12-04 08:05:12
问题 Can someone explain what Fork/Join is? 回答1: 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

add a jar to maven exec:java classpath

非 Y 不嫁゛ 提交于 2019-12-04 07:59:32
I have a batch file which runs a java class using maven which depends on tools.jar (from the JDK). For example: mvn -f .\pom.xml -e exec:java -Dfile.encoding="UTF-8" -Dexec.mainClass=MyClass -Dexec.args="%1 %2 %3 %4 %5 %6 %7 %8 %9" -Dexec.classpathScope=runtime My program uses tools.jar from the JDK and I've added a system dependency in maven which points to it. Since the exec:java goal doesn't include system dependencies, I want to add the dependency from the command line manually. Although I expected it to be trivial I could find the way to do it. Any help will be appreciated. Thanks, Avner

Using ListView from Scala 2.9.2 with Java 7 gives compile error

不羁的心 提交于 2019-12-04 07:34:26
I'm working on a project that use scala 2.9.2 and java 7. What I'm trying to do is create a GUI using the scala ListView. Here's a small code snippet: private val listView = new ListView[Document](someList) . . . for (selectedDocument <- listView.peer.getSelectedValuesList) { doSomething(selectedDocument) } This gives me the following compile error: error: something is wrong (wrong class file?): class JList with type parameters [E] gets applied to arguments [], phase = namer for (selectedDocument <- listView.peer.getSelectedValuesList) { I'm guessing this is because in ListView, peer is

Java 7 Debug on Windows 8 not working

余生颓废 提交于 2019-12-04 07:26:03
I am trying to debug an applet on Windows 8 using Java 1.7.0_21. I have added the bleow to the runtime parameters. -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 When I try to connect I get "Could not open connection to the host, on port 5005" error on both local and remote machines. If I do a netstat -an I don't see any port 5005 listening. It seems the JVM is not opening the listening debug port. I have added the port to the firewall and even completely disabled the firewall, but no difference. Has anyone else here tried to debug Java 7 on Windows 8? Thanks I'm having the

Oracle JDK installs two JREs?

拟墨画扇 提交于 2019-12-04 07:26:02
Before downvoting or close-requesting this question please see that this question is about JDK 7 not 6, it has a second question 'Q2' which is not addressed by any duplicate thread and this question is about four not only two java.exe instances. Thank you! I've just installed Oracle's Java SE JDK (64 bit) which resulted in the following directory layout, and somehow two JREs: C:\Program Files\Java\ \jdk1.7.0_40 \jre \jre7 I'm now the proud owner of four java.exe executables: C:\Program Files\Java\jdk1.7.0_40\bin\java.exe C:\Program Files\Java\jdk1.7.0_40\jre\bin\java.exe C:\Program Files\Java