my dog learned polymorphism
The moose likes Beginning Java and the fly likes Compiling Code without a class file! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compiling Code without a class file!" Watch "Compiling Code without a class file!" New topic

Compiling Code without a class file!

Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 281

hey Guys,

first let me tell you the project details,

Details - Its a very small project having 3 classes and certain number of jars in its class path in the batch file.

now for the problem -

Out of those 3 classes - I have the problematic situation in just one small method in a small class -

Situation - In the class I have a method which throws two exceptions lets say...
method throws ConfusedException, ExampleException {

now after analysis, I found out that this method never throws the ConfusedException and it's just a leftover from previous codes that have been there... (very old application)...

okay when I compile the entire class with the existing jars on the main server it compiles fine and even runs! but when I took the code to my local machine and imported to eclipse it was showing me compile time errors, I tried to run it on my local machine...but..

Weird Problem - There is no class called ConfusedException (in my case) and its not even there inside any jars, nowhere absolutely nowhere! not even as an inner class..... I found out a dependency tool which lists out the dependent classes that tool listed all the paths but for this class its showed up as "NA"

I am actually confused as - from where this class is taken in the server and howcome I'm not getting the class ? I have even searched all the system files and jars in the original system where this runs fine for that class and also my local machine.. the file is not found anywhere... I just want to know where all I should look for this class.

Time is what we want the most, but what we use the worst. -- William Penn
David Newton

Joined: Sep 29, 2008
Posts: 12617

If you can compile it then ConfusedException exists in *something* on your classpath.

Have you examined each of the jars on the classpath when you compile?
I agree. Here's the link:
subject: Compiling Code without a class file!
jQuery in Action, 3rd edition