• Post Reply Bookmark Topic Watch Topic
  • New Topic

MyFirstApp  RSS feed

 
Ryan Medrano
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone... i've finally got my java to work in the path section of my enviroment variables.. the only thing that i have ran into.. is getting MyFirstApp to acutlly work.. This is what MyFistApp is programed to do

public class MyFirstApp {

public static void main (sting[] args) {
system.out.println("I Rule!");
system.out.println("The World");

}


}

now.. when goto command promt and type "javac MyFirstApp.java" (without quotes) is says this

javac: file not found : MyFirstApp.java
Usage: javac <options> <source files>
use -help for a lis of possible options

so... please could someone give me a hand on this?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you have the file named "MyFirstApp.java"?

Note that the case MUST be the same as what's in the java file. It will not work if you have "myFirstApp.java", for example.
 
Gabriel White
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MyFirstApp.java must exist. If you goto the directory where that file exists and then run that command it will work and compile your .java file into a .class file and run when you type java MyFirstApp.java.

If you created your file (in a text editor or wherever) you will have to save the extension as type .java.

Ensure this and it will work.

HTH
 
Ryan Medrano
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YESSSSSSSSSSSSSSSS!!!

Bless the lord!!! i got it!!!

Thank you everyone!!! For all your help and support!!!
THANK YOU SOOOOOO MUCH!!!
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So pleased you have finally got it to work. That initial stage with the installation and setting the PATH variable is one of the most difficult of all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!