Something wrong with setting up Bukkit server for Minecraft?

So I'm trying to set up a Bukkit server for Minecraft so I can use some plugins for world edit but it's not working properly. I've downloaded the server and I put it into a new folder and make a new text document and put the server code in it and save it as a.bat file. After I do that and go to open the.bat it'll open but then close out of the.bat file immediately. What am I doing wrong and how do I fix this?

It depends what your batch (.bat) file contains. If it closes out immediately, it most likely means there's an error preventing the batch file itself from working.

If it isn't already there, try editing the file and on a new line after everything, make it simply say "pause" (without the quotes, of course). From there, the batch file won't close until your press a key to cancel the pause (Basically meaning you can see the error).

---------------------------------------…

From experience, I'm assuming that it might be a problem with RAM, the error message might say something like this:

" Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit. "

If it is this message, the system is trying to use more RAM than what is available - You need to further edit the file to decrease the amount of RAM it's trying to use.

Find the part that looks like "-Xmx1200M" (The number will most likely be different). Keep decreasing the number part (and only the number part) until you can boot your.bat file. From there, it should work!

If the error message is different, you should find MANY results online.

Hope this helps!