Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Kotoshov

  • 4 years ago

Hi, I'm trying to compile and run a program. So I opened an editor (jEdit) and wrote my program in there. I saved it as a .java file and this is my source code (right?). Now, where should I type the order that compiles the file? And the order that runs it? Thanks

  • This Question is Closed
  1. djaquay
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Yes, that's your source code (the .java file). To compile it, you would type "javac source.java" at a command prompt. (In Windows, this means running cmd.exe; on a Mac, Terminal; on Linux, xterm or Konsole or similar.)

  2. djaquay
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Oh, and to run it, you would probably type "java source". I say probably, because there are other things you might need to add to that (i.e. a classpath for other libraries, a package name if your source isn't in the default package, etc.), but "java source" should work.

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy