I have run java apps; however, until now, I've never run the command line version. I created a simple app called "Test.java". The code will compile just fine (using javac); however, I can't get it to run (UNLESS I remove the package from the source code and recompile). Here is the simple code:
This version of the code was placed in a path like: G:\JavaExamples\myPackage\Test.java... again, it compiles just fine; however, I get the error "could not find or load main class...."
I tried using the command line in two ways (in both cases, I started the run by going to the folder in the command prompt):
1. java myPackage.Test
2. java Test
If I comment out the package in the source:
And recompile, I can successfully run the code using: java Test
What am I doing wrong?
Thanks!!
Note: For some reason, my indentations in my code are not showing up in this post; however, when I came back to edit this post, I see them