View Single Post
Old Dec 25th, 2007, 9:29 PM   #1
Energizer
Newbie
 
Join Date: Dec 2007
Posts: 4
Rep Power: 0 Energizer is on a distinguished road
PLEASE PLEASE help up since 1 trying to fix this simple yet stupid problem....

Good morning everyone - Just joined the site!

I really need help/advice/instuctions....To cut a long story short I have created a few java programs via net beans. Now they compile and run fine via net beans, but I cant find out how to pass arguments into it.

This is usually done via windows separate command line, i.e:

c: javac myCode.java //to compile it

c: java myCode somethingIwantTopassIntoTheCode //to run it with a parameter


it compiles on the command line but when I try to run it I get an error:

Exception in thread "main" java.lang.NoClassDefFoundError: myCode

along with some other rubbish.

So I cant pass arguments via the command line and cant pass arguments via netbeans. I need to do this for some uni work ASAP so If anyone knows how to fix this, or even better how to pass arguments through net bean independently It would help me soo much! As you can see I have been up all night trying to fix this, I have also searched the forums but cant seem to find a similar thread. I have also downloaded eclipse but don’t know how to pass arguments through that either: sad:

I have been told by a friend to: "To specify command line arguments, right click your project node and click properties.
Click the 'compile' tab to specify compiler arguments or click the 'run' tab to specify runtime arguments."

but I found the tabs and places to enter the arguments and entered 4 + 1 and even though I have entered the arguments it still doesn't use the arguments. I have tried this on other code which I am sure is correct, but still doesn’t work. Do I need to do some sort of application/implementation of these arguments?

If anyone knows how to pass arguments through ANY IDE PLEASE tell me how I'l download another programming environment if needs be....

thanks so much!


Energizer
Energizer is offline   Reply With Quote