Jump to content

How to compile at command line?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
zeroradius

zeroradius

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,406 posts
Hi guys,

So I am writing my "Hello World" for Java (very excited) and even thou I have eclipse installed I thought it would be better to learn using notepad(2). So I set up a new library for programming and put a java folder and in it i put my project folder. I went to cmd line and typed javac MyFirstApp.java like my book told me but it says that it is not a valid comand. I checked a few sites and they all said somthing about javac as well. So what am i screwing up here? (I have never compiled anything from command line before)
Posted Image

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
Install JDK and be sure javac is in the PATH environment variable. Try seeing if you have javac included elsewhere first and set it up if so.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
zeroradius

zeroradius

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,406 posts
EDIT1: Thanks for the help. I checked the java board but i just remembered that we have a tutorial section and i found a tut in there. Thanks again ^_^

Edit 2: :crying: I can not get it to work. I set the enviroment path variable Posted Image

and it still won't work.

Edit 3: I'm just going to use eclipse and be done with it

Edited by zeroradius, 02 August 2010 - 01:55 PM.

Posted Image

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
You set the PATH variable! (not javac) It may already have some entries within, so separate each path with a semicolon, this will allow the command line to access javac from its folder without manually pointing to it.

Although, you're on the right track using an IDE, you best still finish this step to be able to do it later on.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
sophisticated

sophisticated

    Newbie

  • Members
  • Pip
  • 1 posts
How do I develop mobile apps????
Thankz....
Sophi.....D

#6
zeroradius

zeroradius

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,406 posts
Alright thanks NullWorm I'll give it a shot later. I feel prety silly now because you told me PATH variable to begin with. I was so frustrated I guess it did not register with me.

Sophisticated. You should start a new thread for your topic. You are more likely to get a responce
Posted Image