Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dan't figure out how to compile.  RSS feed

 
Kyle Skully
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so I've got the book Head First Java and I've downloaded and set up everything it said I needed to. I've created the MyFirstApp.java file in wordpad (I made sure to get rid of the .txt extension).

Now here's my hard part. Compiling it.

How do I ad an entry to my path enviroment variable inside my main java directory (C:\Java)?

After that, I actually compile the code typing '% javac' at the command line . . . of what? Command Prompt?

The book shows compiling (once you get past all that stuff) being as simple as "javac MyFirstApp.java", but I'm finding this much more difficult.

I feel I've overlooked something simple, or there's some common knowledge that I've yet to know. Any help explination, or correction to what I'm doing would be greatly appreciated.
 
Stuart Ash
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These two pointers should help.



http://www.computerhope.com/issues/ch000549.htm

http://www.wilsonmar.com/1envvars.htm
 
Marilyn de Queiroz
Sheriff
Posts: 9080
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I ad an entry to my path enviroment variable inside my main java directory (C:\Java)?

How you add an entry to your PATH environment variable depends on your OS. Stewart pointed you to the instructions for changing your PATH environment variable if you are using WinXP or Win2k. If you are using Win9x or Linux or a Mac, the instructions will be different.

After that, I actually compile the code typing '% javac' at the command line . . . of what? Command Prompt?

Again this depends on which OS you are using. If you are using Linux/Mac, you type "javac MyFirstApp.java" at the command prompt which may look like '%' (if you are using c-shell). If you are using Windows, your command prompt will look more like 'C:\>'. In either case, you type

javac MyFirstApp.java
 
Kyle Skully
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both. All three links (even the one in Myrilyn's sig) helped a lot.

 
Marilyn de Queiroz
Sheriff
Posts: 9080
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!