java-7

Java SimpleDateFormat Parse Wrong Date

元气小坏坏 提交于 2019-11-28 14:11:23
I'm trying to use the parse function of SimpleDateFormat to turn a String into a Date SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-YYYY"); String strInput1 = "29-04-2014"; System.out.println("string 1: " + strInput1); Date date1 = new Date(); try { date1 = sdf.parse(strInput1); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("date 1: " + date1.toString()); String strInput2 = sdf.format(date1); System.out.println("string 2: " +strInput2); Date date2 = new Date(); try { date2 = sdf.parse(strInput2); } catch (ParseException e) { //

Installing Java 7 (Oracle) in Debian via apt-get [closed]

不羁岁月 提交于 2019-11-28 14:04:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Installing Oracle Java 7 in Debian via apt-get repository doesn't seems to work. apt-get install oracle-java7-installer Look like apt-get does not recognize oracle-java7-installer . 回答1: Managed to get answer after do some google.. echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a

appengine endpoint Failed to retrieve API configs with status: 500

旧时模样 提交于 2019-11-28 13:26:33
I run appengine local dev server in eclipse with params 0.0.0.0 When I try to access any of the methods I get the following error. I get the same error if I try to access api explorer http://localhost:8888/_ah/api/explorer Notes: I just updated my app engine server to java 7. Does anyone know how to fix this problem? java.io.IOException: Failed to retrieve API configs with status: 500 at com.google.api.server.spi.tools.devserver.ApiServlet.getApiConfigSources(ApiServlet.java:102) at com.google.api.server.spi.tools.devserver.ApiServlet.initConfigsIfNecessary(ApiServlet.java:67) at com.google

Reordering JList with Drag and Drop

匆匆过客 提交于 2019-11-28 13:25:26
I encountered a problem regarding reordering elements in a JList using Drag and Drop. This following code is a modification of a code where you could drag elements from one JList to another (worked only one way). I tried to make it usable for only one JList, but the elements can't even be dragged out of the list. So I guess it can't be done this way. Any ideas what I'm doing wrong or not taking into consideration? The idea is to get it to work for a Jlist with thumbnails, but since I can't even get it to work with just strings... I have been looking into several D'n'D tutorials, but still I

Is Tomcat 7 now compatible with Java 7?

被刻印的时光 ゝ 提交于 2019-11-28 13:23:59
If not, when is it foreseen for? If yes, do you know if there is something special to migrate an existing installation of Tomcat 7/Java 6 to Tomcat 7/Java 7? Thanks! Officially Java 1.6 or later is supported. This post goes into more detail. Last month (Feb. 2013) I updated my Java from 1.6 to 1.7. However, the update has repercussion - Tomcat 7.0.37 is not running anymore after the Java update. I tried un-installing the Java 1.7, replace with 1.6 and the Apache Tomcat runs smoothly again. I forgot to capture the exact error message and I couldn't find also on the server logs. FYI. Thanks

JDK 1.7 breaks backward compatibility? (generics)

…衆ロ難τιáo~ 提交于 2019-11-28 13:19:09
I've found similar topics, but overly complicated and not quite the same. So the thing is. Here's the(minimal) code which is fine on 1.6, but doesn't compile with 1.7 javac. public class Test { private static class A<T>{}; private static class B{}; private static class C{}; B doSomething(A<B> arg){ return new B(); } C doSomething(A<C> arg){ return new C(); } } On 1.7 the error is this: java: name clash: doSomething(Test.A<Test.C>) and doSomething(Test.A<Test.B>) have the same erasure I understand the type erasure and why it's a wrong code. I just don't understand why we can have this code in

TTF and OTF versions of Source Sans Pro are differently displayed in Swing (Nimbus L&F)

假如想象 提交于 2019-11-28 12:48:22
ttf: otf: both are the same font but different fontfile types I am running Java 7 in Windows 7 According to Miguel Sousa by Adobe the bug is not in the fonts https://github.com/adobe/source-sans-pro/issues/32#issuecomment-23319673 I am just setting the default font to the new font. The TTF version works without any issues Font font_o = Font.createFont(Font.TRUETYPE_FONT, fonts.class.getResourceAsStream("fonts/TTF/SourceSansPro-Regular.ttf")); //Font font_o = Font.createFont(Font.TRUETYPE_FONT, fonts.class.getResourceAsStream("fonts/OTF/SourceSansPro-Regular.otf")); Font font_n=font_o

Is this a Swing Java 7 rendering bug?

匆匆过客 提交于 2019-11-28 12:10:05
I made a simple Swing application. But the rendering behaves buggy. Have I done anything wrong or is it a bug? It's simple a small JFrame with a textfield, button and an empty list. If I first resizes the window horizontally and then type in the textfield, the button suddenly disappear. Here is my code: public class App extends JFrame { public App() { JTextField messageFld = new JTextField(); JButton saveBtn = new JButton("Save"); JPanel inputPanel = new JPanel(new BorderLayout()); inputPanel.add(messageFld, BorderLayout.CENTER); inputPanel.add(saveBtn, BorderLayout.EAST); JList<Data> list =

Java7 ClassFormatError: Illegal local variable table length while creating the object

你。 提交于 2019-11-28 12:09:55
I am getting this strange error while executing the following code. EncoderRequest encoderRequest = new EncoderRequest(sid,appTxnId,pfid,transactionType,"",isUpdatetype9,true); I have checked all the parameter values are valid. I am using java7 plateform. can any one have come across this situation, please help. following is the part of stacktrace i am getting. Caused by: java.lang.ClassFormatError: Illegal local variable table length 48 in method com.cmc.facts.encoder.EncoderRequest.<init>(JLjava/lang/String;Ljava/lang/Long;Lcom/cmc/facts/enums/TransactionType;Ljava/lang/String;ZZ)V at com

Error while trying to use an API. java.lang.NoSuchFieldError: INSTANCE

旧时模样 提交于 2019-11-28 12:09:47
I am trying to connect to the smartsheet api using a java program. Initially I had problems with the site certificate which was resolved by adding it to the java keystore. Now when I am trying to run my code, I get the following error. Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144) at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:955) at org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:58) at com.smartsheet.api.internal.http