From: Robert N. <rn...@cs...> - 2004-02-18 22:31:39
|
that is not compiling, it is running. To compile you would need: javac Test.java running is : java Test Is it possible to set the classpath on a Windows machine like in Unix? This way you would not need to worry about compiling with the classpath. Otherwise I would recommend following the advice in a previous email and use an ide like eclipse. -Robert On Feb 18, 2004, at 5:21 PM, Srikanth Vadde wrote: > I compiled like this > > C:\repast>java -classpath > c:/repast/lib/repast.jar;c:/repast/lib/colt.jar Test > > Exception in thread "main" java.lang.NoClassDefFoundError: Test > > I set the classpath properly only? May be i am wrong? > > -- > > > > Quoting Gulyas Laszlo <gu...@om...>: > >> Assuming that your class' name is Test as in the code below, >> try this: >> >> java Test >> >> Note that you'll also need to set the CLASSPATH properly, >> just like in the case of the GUI mode. >> >> -- gulya >> >> On Wed, 18 Feb 2004, Srikanth Vadde wrote: >> >>> I cannot run as mentioned. It compiles fine, but how do you execute >>> the >> class >>> file? Same as given in the tutorial? I did just that but i get an >>> error >> which >>> says that >>> >>> Exception in thread "main" java.lang.NoClassDefFoundError >>> >>> Here's the code >>> >>> import uchicago.src.sim.engine.SimpleModel; >>> import uchicago.src.sim.engine.SimInit; >>> import uchicago.src.sim.gui.DisplaySurface; >>> import uchicago.src.sim.gui.Object2DDisplay; >>> import uchicago.src.sim.space.Object2DTorus; >>> >>> import uchicago.src.sim.util.*; >>> import uchicago.src.sim.util.Random; >>> import cern.jet.random.Exponential; >>> >>> import java.util.*; >>> import java.lang.Object; >>> >>> >>> public class Test extends SimpleModel { >>> private DisplaySurface dsurf; >>> private int spaceSize; >>> >>> public Test () { >>> params = new String[] { "SpaceSize"}; >>> name = "Expo Dist"; >>> } >>> >>> public void setup() { >>> super.setup(); >>> >>> if (dsurf != null) dsurf.dispose(); >>> dsurf = new DisplaySurface(this,"Sensor Display"); >>> super.registerDisplaySurface("Sensors Display", dsurf); >>> } >>> >>> public void buildModel() { >>> Object2DTorus space = new Object2DTorus(spaceSize, spaceSize); >>> space = new Object2DTorus(spaceSize, spaceSize); >>> >>> Object2DDisplay display = new Object2DDisplay(space); >>> display = new Object2DDisplay(space); >>> >>> dsurf.addDisplayable(display,"Sensors Space"); >>> >>> dsurf.display(); >>> >>> } >>> >>> public void step() { >>> Random.createExponential(0.4); >>> double rand = Random.exponential.nextDouble(); >>> System.out.println("Random Exponential : " + rand); >>> } >>> >>> public int getSpaceSize() { return spaceSize; } >>> public void setSpaceSize(int spaceSize) { this.spaceSize = >>> spaceSize; >> } >>> >>> public static void main(String[] args) { >>> SimInit init = new SimInit(); >>> init.loadModel(new Test(), "test-param.txt", true); >>> } >>> } >>> >> >> -- >> -- >> Laszlo Gulyas las...@sz... >> AI Laboratory http://www.sztaki.hu/~gulyas/ >> Computer and Automation Research Inst. H-1111, Budapest, Kende u. >> 13-17. >> Hungarian Academy of Sciences * 36 30 210-29-66 >> > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Repast-interest mailing list > Rep...@li... > https://lists.sourceforge.net/lists/listinfo/repast-interest |