Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download com.sun.net.httpserver package?

I'm not familiar with where I can get the package com.sun.net.httpserver? I like to use this package in Android.

Thanks!

like image 955
Jona Avatar asked Dec 19 '10 20:12

Jona


3 Answers

You can download it from

https://bintray.com/bintray/jcenter/download_file?file_path=com%2Fsun%2Fnet%2Fhttpserver%2Fhttp%2F20070405%2Fhttp-20070405.jar

It used to be available from Sun for Java 5 but they seem to have pulled the link. Don't know if it works on Android mind you.

Old broken link http://download.java.net/maven/2/com/sun/net/httpserver/http/20070405/http-20070405.jar

like image 112
Daniel Worthington-Bodart Avatar answered Nov 05 '22 09:11

Daniel Worthington-Bodart


It's part of Java SE 6. It's not published separately and also not included in Android. I'd suggest to look for another lightweight Java implementation of a HTTP server, like i-Jetty.

like image 36
BalusC Avatar answered Nov 05 '22 11:11

BalusC


Android studio use jcenter as the default repository source. The more convenient way is adding the dependency to gralde configuration.

The library can be found in jcenter, see here.

So just add it to your project's dependencies.

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    // ...
    compile 'com.sun.net.httpserver:http:20070405'
    // ...
}
like image 3
alijandro Avatar answered Nov 05 '22 09:11

alijandro