jdk1.6

Not able to properly set up the path of java in Windows 7 , 64 bit

旧巷老猫 提交于 2019-12-04 22:29:50
问题 I have installed java 1.6 in my computer and I have also set the path, using the advanced variable settings. At a command prompt when I tried to execute java I got this error: Error: could not open `C:\Program Files\Java\jre7\lib\amd64\jvm.cfg' But when I executed this command from a command prompt: javac -version it was showing that I had the proper version set. javac 1.6.0_27. Someone please help me to solve this error. 回答1: Windows 7 Go to the control panel, "Control Panel\All Control

Deprecate in Java 1.6

二次信任 提交于 2019-12-04 13:45:59
In Java 1.5, to deprecate a method you would: @Deprecated int foo(int bar) { } Compiling this in Java 1.6 results in the following: Syntax error, annotations are only available if source level is 1.5 Any ideas? You have to tell the compiler to use 1.6: javac -source 1.6 Or equivalent for your IDE/build system (as others have suggested). First, its @Deprecated , and second - double-check if you are really compiling with Java 1.6. What are you using? javac? Eclipse? If using javac, make sure your JAVA_HOME is set to point to JDK 6, not JDK 1.4.2 If using Eclipse (or any IDE), right click the

How to shutdown com.sun.net.httpserver.HttpServer?

自作多情 提交于 2019-12-04 12:59:56
问题 The Http Server embedded in JDK 6 is a big help developing web services, but I've got situation where I published an Endpoint and then the code crashed and left the server running. How do you shutdown the embedded server once you've lost the reference to it (or the published Endpoint)? 回答1: I use the below code to start it this.httpServer = HttpServer.create(addr, 0); HttpContext context = this.httpServer.createContext("/", new DocumentProcessHandler()); this.httpThreadPool = Executors

Difference between hh:mm a and HH:mm a

醉酒当歌 提交于 2019-12-04 10:23:35
Here is my original code- String dateString = "23 Dec 2015 1:4 PM"; Locale locale = new Locale("en_US"); SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm a"); DateFormat df = new SimpleDateFormat("dd MMM yyyy HH:mm a", locale); Date date = null; try { date = formatter.parse(dateString); } catch (ParseException e) { LOGGER.error(e); } String newDate = df.format(date); System.out.println("oldDate = " + dateString); System.out.println("newDate = " + newDate); and here is my output- oldDate = 23 Dec 2015 1:4 PM newDate = 23 Dec 2015 01:04 AM There is AM-PM difference between

Using both jdk 1.6 and jdk 1.7 for different projects in Eclipse

↘锁芯ラ 提交于 2019-12-04 10:03:05
I am using Eclipse with JDK 1.7. My previous projects are developed in java 7 and JDK 1.7. Now, I want to build a new project under JDK 1.6 in Eclipse. Is it possible to do that so that some projects are based on JDK 1.7 and some others are based on JDK 1.6 without conflicts? If this can be done, please let me know how to do it step by step. Update: My default JDK is 1.7. I created a new project that is based on jdk1.7 by default. And then I go to the property of this project, and then java compiler, then change the compliance settings as the image shows below. But there is some error occurred

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

@override annotation in JDK 1.6

♀尐吖头ヾ 提交于 2019-12-04 02:51:07
I'm using JDK1.6. When I implement an interface and in the implementing class, if I give @override before my function names, Eclipse throws an compilation error. i.e. below code is wrong according to Eclipse. public class SomeListener implements ServletContextListener { @Override public void contextDestroyed(ServletContextEvent arg0) { // code } /* other overridden methods here */ } If I remove @Override annotation, then the code compiles fine. Does it mean that JDK1.6 does not require us to prefix the @override annotation anymore? You probably need to set the compiler compliance level in

RESTful web service: java.lang.NullPointerException service.AbstractFacade.findAll

非 Y 不嫁゛ 提交于 2019-12-03 19:28:45
I created a simple XML web service using NetBeans 7's "RESTful Web Services from Database..." wizard. At this point, I want to publish a list of users from the associated mySQL database. When I attempt to access the service via its URL (http://localhost:8080/database/resources/users), I get an error that reads "java.lang.NullPointerException". The stack trace: service.AbstractFacade.findAll(AbstractFacade.java:41) service.UserFacade.findAll(UserFacade.java:51) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java

Trouble with SSL https connection on port 8443

时间秒杀一切 提交于 2019-12-03 16:09:22
We are having trouble with the https (port 8443) connection on an app that runs on Tomcat 7. The app is running fine on http (port 80) now. I have uncommented the "Define a SSL ..." section in the server.xml file and set all the property values (see below). However, when I try to run the app through a browser, I get the error, "The remote device or resource won't accept the connection." Also, when I run a port utility on the server to see what ports are open and listening, it displays port 80 for Tomcat, and port 443 is also listening. Java version 1.6, Tomcat 7 versions. Any ideas would be

Not able to properly set up the path of java in Windows 7 , 64 bit

佐手、 提交于 2019-12-03 14:59:59
I have installed java 1.6 in my computer and I have also set the path, using the advanced variable settings. At a command prompt when I tried to execute java I got this error: Error: could not open `C:\Program Files\Java\jre7\lib\amd64\jvm.cfg' But when I executed this command from a command prompt: javac -version it was showing that I had the proper version set. javac 1.6.0_27. Someone please help me to solve this error. Manav Brar Windows 7 Go to the control panel, "Control Panel\All Control Panel Items" Then find java icon, click on it. Select option "Java" right next to the "General" tab.