The Artima Developer Community
Sponsored Link

Java Answers Forum
JXTA PeerGroup Help!

1 reply on 1 page. Most recent reply: Jul 18, 2003 11:32 PM by zenykx

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Willie Tang

Posts: 1
Nickname: nomad888
Registered: Jul, 2003

JXTA PeerGroup Help! Posted: Jul 16, 2003 9:36 AM
Reply to this message Reply
Advertisement
Hi,

Whenever I'm compiling a sample source code in JXTA as shown below:


import java.io.InputStream;

import net.jxta.peergroup.PeerGroup;
import net.jxta.peergroup.PeerGroupFactory;
import net.jxta.exception.PeerGroupException;

/**
* This is a simple example of how an application would start jxta
*/

public class SimpleJxtaApp {

static PeerGroup netPeerGroup = null;

public static void main(String args[]) {

System.out.println("Starting JXTA ....");
SimpleJxtaApp myapp = new SimpleJxtaApp();
myapp.startJxta();

System.out.println("Hello from JXTA group " +
netPeerGroup.getPeerGroupName() );
System.out.println(" Group ID = " +
netPeerGroup.getPeerGroupID().toString());
System.out.println(" Peer name = " +
netPeerGroup.getPeerName());
System.out.println(" Peer ID = " +
netPeerGroup.getPeerID().toString());
System.exit(0);
}

public void SimpleJxtaApp() { }

private void startJxta() {
try {
// create and start the default JXTA NetPeerGroup
netPeerGroup = PeerGroupFactory.newNetPeerGroup();
}
catch (PeerGroupException e) {
// could not instantiate the group, print the stack and exit
System.out.println("fatal error : group creation failure");
e.printStackTrace();
System.exit(1);
}
}
}




i get this error:


SimpleJxtaApp.java:58: package net.jxta.peergroup does not exist
import net.jxta.peergroup.PeerGroup;
^
SimpleJxtaApp.java:59: package net.jxta.peergroup does not exist
import net.jxta.peergroup.PeerGroupFactory;
^
SimpleJxtaApp.java:60: package net.jxta.exception does not exist
import net.jxta.exception.PeerGroupException;
^



can anyone tell me why this is? i have jxta.jar in my classpath already.

=(.


zenykx

Posts: 69
Nickname: zenykx
Registered: May, 2003

Re: JXTA PeerGroup Help! Posted: Jul 18, 2003 11:32 PM
Reply to this message Reply
I dont know the distribution of this, but it may be a problem with your classpath! :)) Try to see where are those classes declared in import statements and include that directory or jar file into your classpath.

Flat View: This topic has 1 reply on 1 page
Topic: Upcasting & Downcasting ! Previous Topic   Next Topic Topic: Database failure detection

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use