• Post Reply Bookmark Topic Watch Topic
  • New Topic

% javac (help)  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i just installed j2sdk version 5.0 and i think i've correctly set my path environments correctly, however, this book i bought (i think) says that i should basically (at the command prompt? - using windows xp) be able to type in % javac <name of source document> and it will compile. instead i have to change directories to the path where my compiler is located and do it there. i have succesfully compiled that way, but i was hoping to make the % javac thing work, but it sells me it's not a correct batch. anyway, thanks.
 
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Robert,

Welcome to JavaRanch!

That "%" is the operating-system prompt on Mac OS X and on other typical UNIX systems; you're not supposed to type it. Imagine your book says

C:\> javac Foo.java

instead -- and just type starting with the word "javac".
 
author
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A couple of other things to check, if the problem isn't that you are typing %:

1. In a DOS window, type:

echo %path%

and make sure that you see the path to the "bin" subdirectory of your Java home directory as one of the entries.

2. Type the command:

java -version

to ensure that the JVM can be found.

3. If you then still cannot successfully get the command:

javac filename.java

to work, it's possible that you accidentally downloaded the Java Runtime Environment (JRE) vs. the Java developers kit; the JRE does *not* come with javac.exe.
 
robert michael
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks! that helped a lot. =)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!