Help!

problem with jikes / httpclient

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Java RSS
Next:  best Depends: line for an app that needs Java 5 b..  
Author Message
Flavio Rump
External


Since: May 13, 2007
Posts: 2



PostPosted: Sun May 13, 2007 10:10 pm    Post subject: problem with jikes / httpclient
Archived from groups: linux>debian>maint>java (more info?)

Hi there

I am having a trouble making jikes compile an httpclient tutorial example:

debian3164lamp:/var/www/test/java# jikes-classpath HttpClientTutorial.java

Found 10 semantic errors compiling "HttpClientTutorial.java":

1. import org.apache.commons.httpclient.*;
^---------------------------^
*** Semantic Error: You need to modify your classpath, sourcepath,
bootclasspath, and/or extdirs setup. Jikes could not find package
"org.apache.commons.httpclient" in:
/usr/share/classpath/glibj.zip
.



2. import org.apache.commons.httpclient.methods.*;
^-----------------------------------^
*** Semantic Error: You need to modify your classpath, sourcepath,
bootclasspath, and/or extdirs setup. Jikes could not find package
"org.apache.commons.httpclient.methods" in:
/usr/share/classpath/glibj.zip
.



3. import org.apache.commons.httpclient.params.HttpMethodParams;
^---------------------------------------------------^
*** Semantic Error: The import
"org/apache/commons/httpclient/params/HttpMethodParams" is not valid,
since it does not name a type in a package.


13. HttpClient client = new HttpClient();
^--------^
*** Semantic Error: Type "HttpClient" was not found.


13. HttpClient client = new HttpClient();
^--------^
*** Semantic Error: Type "HttpClient" was not found.


16. GetMethod method = new GetMethod(url);
^-------^
*** Semantic Error: Type "GetMethod" was not found.


16. GetMethod method = new GetMethod(url);
^-------^
*** Semantic Error: Type "GetMethod" was not found.


20. new DefaultHttpMethodRetryHandler(3, false));
^---------------------------^
*** Semantic Error: Type "DefaultHttpMethodRetryHandler" was not found.


26. if (statusCode != HttpStatus.SC_OK) {
^--------^
*** Semantic Error: No accessible field named "HttpStatus" was found in
type "HttpClientTutorial".


37. } catch (HttpException e) {
^-----------^
*** Semantic Error: Type "HttpException" was not found.


I installed libcommons-httpclient-java, but that seems not to be enough.

Anyone knows what's going on?

Thank you,

Flavio


--
To UNSUBSCRIBE, email to debian-java-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Michael Koch
External


Since: Feb 18, 2005
Posts: 574



PostPosted: Sun May 13, 2007 10:30 pm    Post subject: Re: problem with jikes / httpclient [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, May 13, 2007 at 10:08:01PM +0200, Flavio Rump wrote:
> I installed libcommons-httpclient-java, but that seems not to be enough.
>
> Anyone knows what's going on?

You need to put it onto the classpath when compiling and running.

jikes-classpath -cp /usr/share/java/commons-httpclient.jar HttpClientTutorial.java



Cheers,
Michael
--
.''`. | Michael Koch <konqueror DeleteThis @gmx.de>
: :' : | Free Java Developer <http://www.classpath.org>
`. `' |
`- | 1024D/BAC5 4B28 D436 95E6 F2E0 BD11 5923 A008 2763 483B


--
To UNSUBSCRIBE, email to debian-java-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Flavio Rump
External


Since: May 13, 2007
Posts: 2



PostPosted: Sun May 13, 2007 10:50 pm    Post subject: Re: problem with jikes / httpclient [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

thank you, it compiled!

now I am getting the following though:

java -cp /usr/share/java/commons-httpclient.jar HttpClientTutorial
Exception in thread "main" java.lang.NoClassDefFoundError:
HttpClientTutorial

what's missing here?

Michael Koch wrote:
> On Sun, May 13, 2007 at 10:08:01PM +0200, Flavio Rump wrote:
>
>> I installed libcommons-httpclient-java, but that seems not to be enough.
>>
>> Anyone knows what's going on?
>>
>
> You need to put it onto the classpath when compiling and running.
>
> jikes-classpath -cp /usr/share/java/commons-httpclient.jar HttpClientTutorial.java
>
>
>
> Cheers,
> Michael
>


--
To UNSUBSCRIBE, email to debian-java-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Michael Koch
External


Since: Feb 18, 2005
Posts: 574



PostPosted: Sun May 13, 2007 11:30 pm    Post subject: Re: problem with jikes / httpclient [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, May 13, 2007 at 10:49:13PM +0200, Flavio Rump wrote:
> thank you, it compiled!
>
> now I am getting the following though:
>
> java -cp /usr/share/java/commons-httpclient.jar HttpClientTutorial
> Exception in thread "main" java.lang.NoClassDefFoundError:
> HttpClientTutorial
>
> what's missing here?

You need to put the current dir (where HttpClientTutorial.class is
located) on the classpath too.

For more infos about this I suggest you to read a book about the Java
programming language. These problems are out of the scope for this
mailing list.


Cheers,
Michael
--
.''`. | Michael Koch <konqueror DeleteThis @gmx.de>
: :' : | Free Java Developer <http://www.classpath.org>
`. `' |
`- | 1024D/BAC5 4B28 D436 95E6 F2E0 BD11 5923 A008 2763 483B


--
To UNSUBSCRIBE, email to debian-java-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Blackwell
External


Since: Apr 30, 2006
Posts: 8



PostPosted: Mon May 14, 2007 2:00 pm    Post subject: Re: problem with jikes / httpclient [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Flavio Rump wrote:
> thank you, it compiled!
>
> now I am getting the following though:
>
> java -cp /usr/share/java/commons-httpclient.jar HttpClientTutorial
> Exception in thread "main" java.lang.NoClassDefFoundError:
> HttpClientTutorial
>
> what's missing here?

Flavio,

to extend what Michael Koch said:

consider using downloading these two bibles (free of charge): 1) Sun
Java Tutorial (http://java.sun.com/docs/books/tutorial/) 2) Bruce
Eckel's "Thinking in Java" (http://www.mindview.net/Books/TIJ/)

Also see:

http://javafaq.mine.nu/lookup?40
http://javafaq.mine.nu/lookup?67
http://javafaq.mine.nu/lookup?111

Consider using the Sun JDK to learn and develop Java applications. The
"alternatives" are all non-Java compliant in different degrees (really,
they are).

If you have your panties in a twist over using non Open Source stuff for
learning Java wait for the Sun JDK to go fully Open Source later this or
next year.



Bye bye


--
To UNSUBSCRIBE, email to debian-java-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Java All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum