• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem compiling source code  RSS feed

 
kori leckey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just started to learn to use java and I'm trying to do the hello world application but I can't figure out why it won't allow it to compile... I've read through the common problems and solutions but that didn't help. I added C:\Program Files\Java\jdk1.8.0_111\bin on user variables to my path and the source code was wrote using notepad ++, when I type in cmd prompt  javac -version it brings up the current version ok. my source code was:

I have the java file saved in the Java folder and then this happens when I try to compile...


any help appreciated
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the method that you want is println() -- with a lower case "el" (ie. L). And not printIn() with an upper case "I".

Henry
 
kori leckey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks that fixes it
 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The typo aside, you shouldn't be putting your code under the ProgramFiles directory.

Create a folder for your app in your Documents folder (in Windows), or somewhere similar.
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
This is how I would create the folder. Give these instructions immediately after opening a command line/terminal, which defaults to somewhere in your User space on Windows® or your personal home directory on *nix (Mac/Unix/Linux):-
mkdir java
cd java
You can call the directory anything which fits the naming constraints for the OS. Use the second line (cd java) every time you open a new command line/terminal, and you will go to the same location. You can create directories almost anywhere like that. The instructions are similar for all OSs. I think the instructions are short for make directory and change directory.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!