Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Very basic question from a newbie  RSS feed

 
C. Holtz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am new to java and programming and have just begun the "Head First Java" book by Sierra and Bates. I am in chapter 5 and everything has gone well until now. I have two classes that I am compiling and running and they work perfectly when using Netbeans. However, when I attempt to compile "manually" at a command prompt, the classes do not
appear to "see" each other(cannot resolve symbol error). The class that is calling the methods in the second class will not compile. I have the classes in the same directory. Until this point I have not had any problems compiling and running single classes at the command prompt. Any suggestions? Thanks!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,

Welcome to JavaRanch!

javac -classpath . File1.java

(That's "javac space dash classpath space dot space File1.java")

You've probably got the environment variable CLASSPATH set to something that doesn't include an entry for "." (dot), the current directory.
 
C. Holtz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That worked. Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!