java-7

Android Studio - JDK Problems, Android Studio Meltdown

送分小仙女□ 提交于 2019-12-04 02:09:45
问题 After I updated my Java JDK 8 from Update 40 to 45, all of my projects opened with errors. You know, the red letters over code. When I hit "Alt+Enter" it says to Setup JDK. I've tried uninstalling Java and Android Studio and came up with the same result. I've also tried using Java JDK 7 Update 80 but still come up with the same problems. Please look at these pictures because I don't think I have done a good job explaining the problem. http://i.stack.imgur.com/YaMar.png http://i.stack.imgur

Should I use Groovy's @CompileStatic if I'm also using Java 7

我们两清 提交于 2019-12-04 01:34:07
I've read through the "What's new in Groovy 2.0" and I'm a bit confused about when to use @CompileStatic. The article mentions that the @CompileStatic annotation was added for developers who weren't able to take advantage of the invoke dynamic part of Java7. So developers looking for performance improvements would not see much changes in Groovy 2.0, if they aren’t able to run on JDK 7. Luckily, the Groovy development team thought those developers could get interesting performance boost, among other advantages, by allowing type checked code to be compiled statically. My question is, if I'm

Why java complains about jar files with lots of entries?

送分小仙女□ 提交于 2019-12-04 00:05:43
I stumbled upon following problem - when I create .jar file with more than 65k entries, java complains "Invalid or corrupt jarfile". Example: $ # in fresh dir $ for i in {1..70000}; do touch $i; done $ jar cf app.jar {1..70000} $ java -jar app.jar Error: Invalid or corrupt jarfile app.jar But if I use a bit less files, it works: $ jar cf app.jar {1..60000} $ java -jar app.jar no main manifest attribute, in app.jar I heard that there was 65k files limit in old .zip file format, but Java 7 should use ZIP64 by default already. Why is this happening? Is there a way to fix it? Why is this happening

Java 7 String switch decompiled: unexpected instruction

拥有回忆 提交于 2019-12-03 23:49:13
问题 I have decompiled a very simple class that uses the new Java 7 String Switch feature. The class: public class StringSwitch { public static void main(String[] args) { final String color = "red"; switch (color) { case "red": System.out.println("IS RED!"); break; case "black": System.out.println("IS BLACK"); break; case "blue": System.out.println("IS BLUE"); break; case "green": System.out.println("IS GREEN"); break; } } } Running the Java 7 "javap" against this class, generates an interesting

How to use keytool in Oracle JDK 7 in ubuntu?

对着背影说爱祢 提交于 2019-12-03 21:39:29
I need a MD5 certificate to use in MapView in android. I have JDK 7 from Oracle installed. But running keytool -v -list -alias alias_name -keystore my-release-key.keystore is not giving me the result, instead it says to install openjdk. How to use the keytool in oracle jdk 7. And i am on ubuntu 12.04 64 bit. You can use keytool by doing this: cd /usr/lib/jvm/jdk1.7.0/bin ./keytool -v -list -alias alias_name -keystore my-release-key.keystore Keytool is not in your path by default, but it does not have to be in your path to be usable. Looks like your jdk installation has problems. Check to see

How does one sign up for the JDK CAP (Compatibility and Performance Program) - Early release Notification [closed]

橙三吉。 提交于 2019-12-03 20:46:34
We were/are stung by the new security baseline requirement with Java's release of 7u45, which caused our applet not work until the end user adjusted the security settings the java control panel (see discussion in below question) Java applet manifest - Allow all Caller-Allowable-Codebase If possible we'd like to put a process in place where we can proactively test new jdk releases. Oracle / Sun appears to offer a way to get notified about this. http://www.oracle.com/technetwork/java/index-jsp-137266.html CAP (Compatibility and Performance Program) is an early access program for Java Standard

Connection reset on Jersey with Java 7

别来无恙 提交于 2019-12-03 20:30:32
I'm trying to call an https link with the webTarget of jersey 2.22.2. The code is that: Client client = ClientBuilder.newBuilder().build(); WebTarget target = client.target(uri); MultivaluedMap<String, Object> headers = new MultivaluedHashMap<String, Object>(); headers.add("Content-Type", "application/json"); headers.add("id", id); headers.add("key", key); Response response = target.request().headers(headers).get(Response.class); In Java 8 it's work great, but in Java 7 it's give me this Connection reset Exception. javax.ws.rs.ProcessingException: java.net.SocketException: Connection reset at

How to copy a directory with its attributes/permissions from one location to another?

时间秒杀一切 提交于 2019-12-03 20:22:22
I see a lot of examples that use Files.walkFileTree() to copy a directory and its contents from one location to another, but they fail to take the directory's file attributes and permissions into consideration. Meaning, they just invoke Files.createDirectories() without any attributes or permissions. How does one copy a directory (and its contents) from one location to another without losing file attributes or permissions, using the Java7 core classes? Gili Answering my own question: /** * Copies a directory. * <p> * NOTE: This method is not thread-safe. * <p> * * @param source * the directory

JDK7 Application is getting slow after some Uptime

扶醉桌前 提交于 2019-12-03 18:10:13
问题 We have a large JDK7 application deployed on JBoss using several libraries like Hibernate, Spring and so on. After initial startup of the server, the application runs as expected but after some uptime it becomes very slow. Using a profiler, we have seen that every time certain aspects of out application are slowing down but not always the same aspects. While in one run it might be that hibernate flush slows to a crawl, in another run it might be some DI-code from Spring. What's going on there

Play Framework - can not reserve enough space for object heap

我是研究僧i 提交于 2019-12-03 16:50:20
问题 I made some modifications to my play project and when I try and run it I get errors. >play run Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occured. Program will exit. Is this a common problem? I am fairly inexperienced with the play framework but I have ran my project several times before without encountering this error. Edit: Information regarding java version. >java