sumant sankaran

Greenhorn
+ Follow
since Sep 16, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sumant sankaran

Thanks Ernest,Using reflection helped me out.I need to make these changes in a lot of files now .
12 years ago
Tim,
This was just an example to illustrate a similar problem I was facing. I dont have the source code of the file akin to Sample in the actual scenario.
12 years ago
Thanks Ernest.Unfortunately I might not be able to use the older compiler,we are already using jdk14 for the project.
How can I go about doing this using reflection any pointers on that?If reflection works then I could probably try to use that everywhere where I face this issue ?
12 years ago
Using JDK 1.4

Folks would be great if you could help me out here :


Lets say I have a file called Sample1.java under


<directory>/a/b :


The file Sample1.java is as follows :
package a.b;
public class Sample1
{
public Sample1()
{


}


public static void main(String []args)
{
Sample a =new Sample();
System.out.println("hello world");
}



}


and under <directory>
I have got a class.jar that contains just Sample.class ( no package or
anything,just the class file)

How do I compile this??
I do the following:
<directory>/a/b/javac -classpath .:<directory>/class.jar Sample1.java


I get the following error:
--------------------------------------------------------------
Sample1.java:12: cannot resolve symbol
symbol : class Sample
location: class a.b.Sample1
Sample a =new Sample();
^
Sample1.java:12: cannot resolve symbol
symbol : class Sample
location: class a.b.Sample1
Sample a =new Sample();
--------------------------------------------------------------


How do I resolve this issue?What am I doing wrong here.
Please dont ask me to put the Sample.class in a package , I wont be
able to do that since that jar is actually already available.


Thanks
Sumant
12 years ago