I would like to connect some domain with java code. I can connect the domain in the browser as follow: http://username:password@domain.com
I tryed the following:
Oracle has announced the removal of those classes in Java 9.
You should not be using classes that are in sun.*
packages - those classes are not part of the public API of Java and can change in any new Java version.
See Why Developers Should Not Write Programs That Call 'sun' Packages in Oracle's documentation.
Instead of using class sun.misc.BASE64Encoder
:
If you are using Java 8, then use class java.util.Base64 for Base 64 encoding and decoding.
Otherwise, use a third-party library, for example class org.apache.commons.codec.binary.Base64 from Apache Commons Codec.