javax.net.ssl.HttpsURLConnection

M

ma2thieu

Hello,
I need the library javax.net.ssl.HttpsURLConnection.
But all the package i find where there is javax.net.ssl do not
contained the class HttpsURLConnection.
Does anyone have an idea where i can find it ?
Thank's a lot for your help
Sorry for my English… I'm French ;)
 
C

Christophe Vanfleteren

ma2thieu said:
Hello,
I need the library javax.net.ssl.HttpsURLConnection.
But all the package i find where there is javax.net.ssl do not
contained the class HttpsURLConnection.
Does anyone have an idea where i can find it ?
Thank's a lot for your help
Sorry for my English… I'm French ;)

<http://java.sun.com/j2se/1.4.2/docs/api/javax/net/ssl/HttpsURLConnection.html>

Are you using a JDK > 1.4?
As you can see in the Javadocs, this is the first JDK the class appeared in.
 
K

KC Wong

I need the library javax.net.ssl.HttpsURLConnection.
But all the package i find where there is javax.net.ssl do not
contained the class HttpsURLConnection.
Does anyone have an idea where i can find it ?

Use Winzip or JAR to look inside jsse.jar inside your JRE's lib directory.
HttpsURLConnection.class is right there. But I guess this is not your real
problem.

Try this in command prompt:

javap javax.net.ssl.HttpsURLConnection

It will display the class declaration and method signatures of the class.
You'll see it's an *abstract* class.

I guess that's your real problem - trying to instantiate HttpsURLConnection.
To use HttpsURLConnection, you use an implementation (subclass) of it. This
post, found via Google Groups, has an example.

(http://groups.google.com/groups?q=HttpsURLConnection+create&start=10&hl=en&
lr=&ie=UTF-8&selm=f8db8edf.0207240927.4a82e25b%40posting.google.com&rnum=13)
 
M

ma2thieu

KC Wong said:
Use Winzip or JAR to look inside jsse.jar inside your JRE's lib directory.
HttpsURLConnection.class is right there. But I guess this is not your real
problem.

Try this in command prompt:

javap javax.net.ssl.HttpsURLConnection

It will display the class declaration and method signatures of the class.
You'll see it's an *abstract* class.

I guess that's your real problem - trying to instantiate HttpsURLConnection.
To use HttpsURLConnection, you use an implementation (subclass) of it. This
post, found via Google Groups, has an example.

(http://groups.google.com/groups?q=HttpsURLConnection+create&start=10&hl=en&
lr=&ie=UTF-8&selm=f8db8edf.0207240927.4a82e25b%40posting.google.com&rnum=13)


I used winrar and i looked inside the package, there were not the class I want.
The problem is not a problem of instantiation : the class is not found by eclipse.
but I used the jdk 1.3.1, maybe the problem is there. May I download the last jdk ?

thank you both
 
M

ma2thieu

KC Wong said:
Use Winzip or JAR to look inside jsse.jar inside your JRE's lib directory.
HttpsURLConnection.class is right there. But I guess this is not your real
problem.

Try this in command prompt:

javap javax.net.ssl.HttpsURLConnection

It will display the class declaration and method signatures of the class.
You'll see it's an *abstract* class.

I guess that's your real problem - trying to instantiate HttpsURLConnection.
To use HttpsURLConnection, you use an implementation (subclass) of it. This
post, found via Google Groups, has an example.

(http://groups.google.com/groups?q=HttpsURLConnection+create&start=10&hl=en&
lr=&ie=UTF-8&selm=f8db8edf.0207240927.4a82e25b%40posting.google.com&rnum=13)

It was a good idea, thanks :
I have downloaded the jdk1.5 (beta)
There is the jsse.jar and the class i want
I put it in my eclipse project
I compile (all is ok)
I make a .jar with my project (no problem)
And when i run : java.lang.NoClassDefFoundError: javax/net/ssl/HttpsURLConnection

Any idea of what is the problem ?
 
K

KC Wong

It was a good idea, thanks :
I have downloaded the jdk1.5 (beta)

Yes, I missed that one - Christophe Vanfleteren is correct. You need at
least 1.4 or later to use the class.
There is the jsse.jar and the class i want
I put it in my eclipse project
I compile (all is ok)
I make a .jar with my project (no problem)
And when i run : java.lang.NoClassDefFoundError: javax/net/ssl/HttpsURLConnection

Any idea of what is the problem ?

Then the problem is most likely in your runtime environment. Do you run it
inside Eclipse or outside?

If you're running it outside Eclipse, type in command prompt:

java -version

to make sure you're using version 1.5 beta. If it shows your old version
(1.3), then you'll need to configure your PATH and JAVA_HOME environment
variables.
 
M

ma2thieu

Yes, I missed that one - Christophe Vanfleteren is correct. You need at
least 1.4 or later to use the class.

Then the problem is most likely in your runtime environment. Do you run it
inside Eclipse or outside?

If you're running it outside Eclipse, type in command prompt:

java -version

to make sure you're using version 1.5 beta. If it shows your old version
(1.3), then you'll need to configure your PATH and JAVA_HOME environment
variables.

Finally i solve the problem : it was not the good package

(there are at least three :
javax.net.ssl
com.sun.net.ssl
and (the one i need) com.sun.net.ssl.internal.www.protocol.https )

thank you for helping me
 
M

ma2thieu

KC Wong said:
Yes, I missed that one - Christophe Vanfleteren is correct. You need at
least 1.4 or later to use the class.

Then the problem is most likely in your runtime environment. Do you run it
inside Eclipse or outside?

If you're running it outside Eclipse, type in command prompt:

java -version

to make sure you're using version 1.5 beta. If it shows your old version
(1.3), then you'll need to configure your PATH and JAVA_HOME environment
variables.

sorry i did not see your answer before, and you are right
I was outside eclipse, and that was not the jdk 1.5, and i cannot
change the jdk, so i had to find another solution
(find another package which works with 1.3)

Thanks a lot!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top