swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] From Eclipse to the Command Line


From: Kyle Newton
Subject: Re: [Swarm-Support] From Eclipse to the Command Line
Date: Mon, 14 Aug 2006 08:42:51 -0700

Thanks for the reply. That does in fact create a jar, which could be handy for myself in the future. I'm still having the same problem, though. What I want to do is run my program from within the Linux command line. I've written my program from within Eclipse on the Windows XP platform. The tutorials written by the Steves has me setting classpaths within my code to my .jar that is associated with my current project. The jar is automatically 'created' by Eclipse and will compile and run without any funny business. However, when I move those .java files and the existing .jar to this SuSE terminal and try to compile and run then I get the following error:

address@hidden:~/beeSim/beeSimNewton> javaswarm StartBeeModel
Exception in thread "main" java.lang.NoClassDefFoundError: StartBeeModel (wrong name: beeSimNewton/StartBeeModel)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

I suppose I could go through my code and replace any mention of the package beeSimNewton with a classpath, but I was wondering if there is a way to avoid having to do that. It works from Eclipse, how might I get it to work from the Linux command line? Thank you.

On 8/10/06, Marcus G. Daniels <address@hidden> wrote:
Kyle Newton wrote:
> What might I be missing? I've tried running it at follows:
>
> $ javacswarm *.java
> $ javaswarm -classpath /my/path/mypackage.jar StartModel
>
> and other variations and still no luck. I've copied the .jar into the
> same directory as my .java files, which is where I'm running the
> commands from. I'm missing somethere here.
If you are asking how to make a jar file, you collect the class files
from the first command into a jar file like so:

jar cf /my/path/mypackage.jar *.class

adjusting /my/path as appropriate..


_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


reply via email to

[Prev in Thread] Current Thread [Next in Thread]