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!

  • Styles and themes on values, values-v11 and values-v14 folders
  • “Permission denied for the attachment” (on Gmail 5.0) trying to attach file to email intent
  • How to deal with removal of a permission for a broadcast receiver in Android M?
  • Android SQlite Leak Problem with CursorAdapter
  • Get list of dependencies runtime
  • How to set webview client?
  • Related posts:

    “Protected Apps” setting on Huawei phones, and how to handle it
    Where is the bundle of onSaveInstanceState saved?
    Gmail tablet style scroll bars with transparent actionbar
    Android listview no longer highlights selection onclick
    android - out of memory exception when creating bitmap
    How to compile cordova project from visual studio (Hybrid App) to android / ios apk
  • SQLiteConstraintException: error code 19: constraint failed
  • Android, google maps fragment and viewpager - Error inflating class fragment
  • Disable/Remove floating label hint text in TextInputLayout XML
  • Detect Scroll Up & Scroll down in ListView
  • Samsung Galaxy S2 2.3.5+ not calling overScrollBy()
  • How to get the current Time
  • 3 Solutions collect form web for “How to download com.sun.net.httpserver package?”

    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.

    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

    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'
        // ...
    }
    
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.