exception in thread "main" java.lang.NoClassDefFoundError

J

juicy

i try to compile and run the code helloworld but there is an exception in
thread main..
Exception in thread "main" java.lang.NoClassFoundError: helloworld <wrong
name: net/jxta/impl/shell/bin/helloworld/helloworld
what cause the problem and how to solve?

i compile with :
set
classpath=.\beepcore.jar;.\jxta.jar;.\cryptix32.jar;.\cryptix-asn1.jar;.\javax.servlet.jar;.\jxtaptls.jar;.\jxtasecurity.jar;.\jxtashell.jar;.\log4j.jar;.\minimalBC.jar;.\org.mortbay.jetty.jar;.\;%classpath%
javac *.java
pause

and run with:
set
classpath=.\beepcore.jar;.\jxta.jar;.\cryptix32.jar;.\cryptix-asn1.jar;.\javax.servlet.jar;.\jxtaptls.jar;.\jxtasecurity.jar;.\jxtashell.jar;.\log4j.jar;.\minimalBC.jar;.\org.mortbay.jetty.jar;.\;%classpath%
java helloworld
pause

all the jar file has been put inside the same directory

here is the code
package net.jxta.impl.shell.bin.helloworld;

import net.jxta.impl.shell.ShellApp;
import net.jxta.impl.shell.ShellEnv;
import net.jxta.impl.shell.ShellObject;

import net.jxta.peergroup.PeerGroup;


/**
* A simple example command for the JXTA Shell.
*/
public class helloworld extends ShellApp
{
/**
* The shell environment.
*/
private ShellEnv theEnvironment;


/**
* Invoked by the Shell to starts the command.
*
* @param args a set of arguments passed to the command.
* @return a status code indicating the success or failure
* of the command.
*/
public int startApp(String[] args)
{
println("Starting command...");

// Get the shell's environment.
theEnvironment = getEnv();

// Use the environment to obtain the current peer group.
ShellObject theShellObject = theEnvironment.get("stdgroup");
PeerGroup aPeerGroup = (PeerGroup) theShellObject.getObject();

// Check to see if there were any command arguments.
if ((args == null) || (args.length == 0))
{
// Print the peer name to the console.
println("My peer name is " + aPeerGroup.getPeerName());
}
else
{
println("This command doesn't support arguments.");

// Return the 'parameter error' status code.
return ShellApp.appParamError;
}

// Return the 'no error' status code.
return ShellApp.appNoError;
}

/**
* Invoked by the Shell to stop the command.
*/
public void stopApp()
{
// Do nothing.
}
}
 
M

Mike Schilling

juicy said:
i try to compile and run the code helloworld but there is an exception in
thread main..
Exception in thread "main" java.lang.NoClassFoundError: helloworld <wrong
name: net/jxta/impl/shell/bin/helloworld/helloworld
what cause the problem and how to solve?
...
and run with:
set
classpath=.\beepcore.jar;.\jxta.jar;.\cryptix32.jar;.\cryptix-asn1.jar;.\javax.servlet.jar;.\jxtaptls.jar;.\jxtasecurity.jar;.\jxtashell.jar;.\log4j.jar;.\minimalBC.jar;.\org.mortbay.jetty.jar;.\;%classpath%
java helloworld

Your class's name is net.jxta.impl.shell.bin.helloworld.helloworld, but
you're trying to run helloworld (in the default package). Try

java net.jxta.impl.shell.bin.helloworld.helloworld
 
Joined
Jul 8, 2009
Messages
1
Reaction score
0
Hey there

Hey Mike,

Can you pls tell me where tp download these Jar files from needed for JXTA...

am completely lost in setting up for JXTA..
ne help is appreciated...downloaded the standard jar from
JXTA web site
which gives just 4 jars.

Regards,
Manuel.
 

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,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top