class extention: “pack.MyJava”Ī bat file can be nothing than other than a dos command you would type, but handily store in a file so you don’t have to type it over and over and over The fully qualified name of the class, this means: including the package structure, but without the. The quotes are only needed when there are spaces within the path or filename, good practice to always use them (for any path)Ĭlasspath to the top of the package structure containing your class, we can shorten it to cp for java, and the jar containing the imported classes (you’ll want to know about including jars eventually): The the path to, and the java filename: “C:\java\pack\MyJava.java” Note: jars will have to be included individually, you can’t just specify the directory Ie: the classpath for some jar, just to show the classpath: If you’re compiling outside out the directory that has the source file, you’ll also need the path to the directory that has the top of the package structure. If you’re using a package other than a java package, you’ll need a classpath. (as will reading the EditPlus documentation) Understanding what information java and javac need to run properly will help you in that regard. I don’t use EditPlus, so I don’t know what it has available for certain, but I suspect you can configure it to be a bit more flexible than your current settings. If you want to get into an IDE, get an IDE, if you want to get into Java, stick with what you have and learn to use it. If you really want to get into Java you should try an IDE
What the heck!!!? All that typing to run a program? There has to be a better way!! Doesn’t there? Then once gain hand type(instead of being able to use my buttons in EditPlus):Īnd if that works, then I have to switch back to: I have to create a sub folder called Pack1 and put my file containing A and DemoA in there, then change the DOS prompt to the Pack1 directory: As far as I can tell, for a simple program like this:
Then, to run a program, I had to open a DOS window and change the prompt to the proper directory:Īfter awhile, I figured out how to make C:\javaPrograms the default prompt, so that saved me from having to change the prompt everytime I opened up a DOS window(in a DOS window click on the Properties icon, and on the Programs tab next to “Working:”, list the default prompt you want)Īnd if that was successful, I had to type:
(See: where there is a link on how to update the PATH variable) I am running my programs in a DOS window, and when I first started, it took me several days to straighten out the PATH to refer(?) to a directory where I could run programs. I think the most frustrating thing about learning java is running programs.