Actually, there is no problem with the code. To make the problem even stranger, I can compile the classes into Tomcat using Ant, and they will work in Tomcat when I have a
servlet make the call, but they still do not work under a command prompt in Linux. I have tested multiple examples within the java examples provided and as soon as one class
attempts to declare a reference to another class I get the 'cannot resolve symbol' error. I know my code was rather trashy, but it actually does fall within properly defined java.
Just some quick and dirty test code in an attempt to arrow down the problem.
Thanks for everyone's suggestions, but I would really like to get this resolved. Currently I am planning on developing in win2K (and having to reboot several times a day) and then
copy the .java files to Linux and use Ant to compile and deploy the files. I am working on a servlet application so this should work just fine. I may have more problems when I
move into the backend integration using EJBs with JBoss, but hopefully this same methodology will work.
Jim
11/13/01 04:10:34 PM, David Garnier
Hello everyone,
I hope this is rather simple, but I am getting a strange error in code. I have two classes, one calls the other to return a string. It is very simple code:
public class returnList { public String[] returnList() { String lStr = "hello"; String [] lRetStr = new String[1]; lRetStr[0] = lStr; return lRetStr; }
} I'm really surprised that this compiles under Windows. Your constructor (returnList()) shouldn't return anything. It should be:
Le Mardi 13 Novembre 2001 22:49, James Bliss a écrit : public returnList()
I bet you should create an empty constructor : public returnList(){} and put you code inside a method:
public String[] getList() { String lStr = "hello"; String [] lRetStr = new String[1]; lRetStr[0] = lStr; return lRetStr; }
AND
//import java.sql.*; //import org.gjt.mm.mysql.*;
public class test_db { public static void main(String[] Args) { returnList lList = new returnList(); String lStr[] = lList.returnList(); System.out.println(lStr[0]); } }
I think this is fine, altough I'm not used to work with arrays.
When I - javac returnList.java it compiles just fine.
When I - javac test_db.java
I get: test_db.java:8:cannot resolve symbol symbol : class returnList Loction : class test_db returnList lList = new returnList(); ^
This code compiles just fine in Windows. I assume that I am missing a library or that I have not installed a package.
Can anyone give me a hand with this?
Thanks for your help,
Jim
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com
participants (1)
-
James Bliss