Compiling JAVA programs using .jar libs

P

Piotrek

Hello all,
I'm a newb to java and all its properties, so please forgive the
ignorance.
I'm trying to compile a simple XmlRpcClient example using the apache
xmlrpc bin package and am having difficulty doing so successfully.
Would anyone care to help me out, please?

Here's the simple class:
<code>
import org.apache.xmlrpc.XmlRpcClient;
import java.util.Vector;

public class MyClient {

public static void main( String args[] ) throws Exception {

XmlRpcClient client = new XmlRpcClient( "http://localhost:
45000/" );

Vector params = new Vector();
params.addElement( "guest" );

Object result = client.execute( "show", params );

if ( result != null )
System.out.println( "Successfully showed guest
account." );
}
}
</code>

Here's the $CLASSPATH:
echo $CLASSPATH
/opt/xmlrpc-3.1/lib/xmlrpc-server-3.1-sources.jar:/opt/xmlrpc-3.1/lib/
xmlrpc-server-3.1-javadoc.jar:/opt/xmlrpc-3.1/lib/xmlrpc-
server-3.1.jar:/opt/xmlrpc-3.1/lib/xmlrpc-common-3.1-sources.jar:/opt/
xmlrpc-3.1/lib/xmlrpc-common-3.1-javadoc.jar:/opt/xmlrpc-3.1/lib/
xmlrpc-common-3.1.jar:/opt/xmlrpc-3.1/lib/xmlrpc-client-3.1-
sources.jar:/opt/xmlrpc-3.1/lib/xmlrpc-client-3.1-javadoc.jar:/opt/
xmlrpc-3.1/lib/xmlrpc-client-3.1.jar:/opt/xmlrpc-3.1/lib/ws-commons-
util-1.0.2.jar:/opt/xmlrpc-3.1/lib/commons-logging-1.1.jar

Here's the error:
javac MyClient.java
MyClient.java:1: cannot find symbol
symbol : class XmlRpcClient
location: package org.apache.xmlrpc
import org.apache.xmlrpc.XmlRpcClient;
^
MyClient.java:8: cannot find symbol
symbol : class XmlRpcClient
location: class MyClient
XmlRpcClient client = new XmlRpcClient( "http://localhost:
45000/" );
^
MyClient.java:8: cannot find symbol
symbol : class XmlRpcClient
location: class MyClient
XmlRpcClient client = new XmlRpcClient( "http://localhost:
45000/" );
^
Note: MyClient.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors

Any and all help will be much appreciated.
Thanks!
P
 
M

Mark Space

Piotrek said:
Hello all,
I'm a newb to java and all its properties, so please forgive the
ignorance.
I'm trying to compile a simple XmlRpcClient example using the apache
xmlrpc bin package and am having difficulty doing so successfully.
Would anyone care to help me out, please?

Here's the simple class:
<code>
import org.apache.xmlrpc.XmlRpcClient;

Dunno but here's a guess:

<http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/client/XmlRpcClient.html>

Note the "client" in the package name, I think you should have:

import org.apache.xmlrpc.client.XmlRpcClient;
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top