Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How come I got a error like this?  RSS feed

 
Timothy Chin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I installed jdk1.5.0 version and set all variables to its directory.
When I ran the javac command, it kept saying cannot read java file.
Can someone tell me where went wrong?
Thanks!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Timothy Chin!

What's the result of the following command?

javac -J-version
 
Timothy Chin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it like this
error: cannot read: programname.java
1 error
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you ran the exact command I suggested, and nothing but the exact command I suggested?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set

Set the path:

Then try again.

In general it's a good idea to get in contact with the basics of your OS.
[ September 26, 2004: Message edited by: Stefan Wagner ]
 
Timothy Chin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ran your command but I am not sure how to use -J-version.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The -J-version part is just a switch passed to the Java compiler when running it.

The command should be run exactly as I posted it, all in one line, and then just press enter after it, without referring to anything else like source files.

I'm suggesting this because I suspect that your J2SDK might be installed properly, and I just want to help you make sure of that.

So, what's the result of just running the following command from a command prompt?

javac -J-version

The following is a screen shot of what this command does for me.


[ September 26, 2004: Message edited by: Dirk Schreckmann ]
 
Timothy Chin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I do not get that message. It still doesn't recognize javac.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!