Can't use com.sun.net.HTTPServer.httpserver

I am using Eclipse Indigo and Java jdk7.

I would like to create a litte webserver, but I cannot use sun webserver.

When I type:

{
 com.sun.net.httpserver.httpserver server;
}

      

I am getting the following Eclipse-Error message:

Description Resource    Path    Location    Type
Access restriction: The type HttpServer is not accessible due to restriction
    on required library C:\jdk1.7.0\jre\lib\rt.jar
Server.java /REST-Server/src/com/test/restserver    line 7  Java Problem

      

What am I doing wrong here? I don't need to include any other jar? I AM?

+3


source to share


1 answer


You should not use Sun's internal packages as they cannot be present in other virtual machines. If you are sure you will not use another VM then Sun / Oracle, you can disable this warning in project properties -> Java Compiler -> Errors / Warnings -> Deprecated and Limited API



+8


source







All Articles