• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Can't compile : Class not found

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I'm having problem compiling my code

I have a jar file with some interfaces located at c:\temp\jarfile.jar

I'm implementing these interfaces using two classes Hello & Bye

both Hello & Bye are located in folder c:\temp\status and both start with "package status;"


and thats how they begin


when i compile Hello, I get an exception that Bye cannot be found at this line "cannot find symbol: Class Bye"



thats the command i'm using to compile the code


Thank you
[ September 03, 2008: Message edited by: Clair McGray ]
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Clair,

Welcome to JavaRanch!

The classpath needs to include the current directory, or else javac won't look there for status/Bye.java . So

c:\temp> javac -cp .;c:\temp\jarfile.jar status\Hello.java


That "dot semicolon" adds the current directory to the classpath.
 
Marshal
Posts: 64651
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also try compiling Bye and Hello together:

c:\temp> javac -cp .;c:\temp\jarfile.jar status\Hello.java status\Bye.java
 
Clair McGray
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that works

Thanks alot
 
Clair McGray
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Campbell Ritchie:
Also try compiling Bye and Hello together:

c:\temp> javac -cp .;c:\temp\jarfile.jar status\Hello.java status\Bye.java



I see! No wonder why it didnt work...

By the way, it works when i use my previous command and include both java files..
without ".;"

You've made my day, i've been trying and trying
 
Campbell Ritchie
Marshal
Posts: 64651
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not nearly as trying as us bartenders. And you're welcome. It is surprising how much annoyance you can get from such tiny things. What happens is that when you import a class and try to compile, the compiler seems to assume the imported class has already been compiled.
 
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!