This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
OK, this suggests something has set a CLASSPATH environment variable on your machine, which is telling Java to look elsewhere than your current directory for class files. You need to tell Java, "No, look RIGHT HERE!" Which you can do by typing:
java -cp . Shuffle1
(That's java space dash cp space dot space Shuffle1).
P.S. Did you compile the code first? If not, then before typing the above, type
javac Shuffle1.java
You need to do this every time you change Shuffle1.java .
Steve Grosz wrote:
I don't have a program called javac (searched Windows 7 and came up dry).......
Then there is a chance that you installed the JRE -- and not the JDK. The JRE is used only for running java programs, it isn't for development, and hence, doesn't include the compiler.
Java is case-sensitive. String should be String, not string. System should be System, not system.
Steve Grosz
Greenhorn
Joined: Jan 13, 2011
Posts: 7
posted
0
Wow, so thanks to EVERYONE who helped this newbie get his really exciting 1st program to work!!
So, Java is that picky that certain commands are case sensitive??? Wow........hopefully I get used to that!!
I'm just using Notepad right now, if I use something like Eclipse later on, will it make the change for me for those reserved words??
Steve Grosz wrote:So, Java is that picky that certain commands are case sensitive??? Wow........hopefully I get used to that!!
I'm just using Notepad right now, if I use something like Eclipse later on, will it make the change for me for those reserved words??
Yes, and fortunately it is case sensitive! Suppose that it wasn't, and people would start writing programs with the case of words differently each time. One time you'd write "System", the other time "system" or "SYSTEM", or "sYsTeM". It would make the program look very messy and make it really hard to understand.
IDEs like Eclipse have lots of built-in editing help features, like warning you if you make a typo.
The standard Windows Notepad is very basic. You could have a look at an editor such as Notepad++ (free), which has syntax color highlighting for Java (and lots of other languages) but not all the complication of a full IDE such as Eclipse.
Agree about Notepad++. Excellent product. Yes, Eclipse will help you correct such errors, but it is probably a good idea to stick to a text editor at this stage.
And in Java™, all commands are case-sensitive, except possibly the "L" or "F" you append to long and float numbers, and the "x" in hexdaecimal numbers.