How to download com.sun.net.httpserver package?
Asked Answered
T

3

13

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

Thanks!

Twostep answered 19/12, 2010 at 20:45 Comment(4)
why you want this package in your app ?Annals
This contains a HttpServer classes for building a simple server. I like to have that functionality.Twostep
java2s.com/Code/Jar/h/Downloadhttp221jar.htm - I download all my java libraries from java2s.comQuadrivial
JEP 408: Simple Web ServerSelfevident
S
5

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.

Stingaree answered 19/12, 2010 at 20:53 Comment(1)
Thanks for the info. I actually now understand where this packages come from :PTwostep
T
13

You can download it from:

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

Old, broken links:

Treblinka answered 18/10, 2011 at 11:10 Comment(2)
Thank you! This worked for me. I didn't need it to work on Android; I only needed it for a test harness.Corinnacorinne
bintray is now a broken linkRodrick
S
5

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.

Stingaree answered 19/12, 2010 at 20:53 Comment(1)
Thanks for the info. I actually now understand where this packages come from :PTwostep
N
3

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'
    // ...
}
Natalianatalie answered 27/6, 2016 at 11:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.