This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes problems with my symbols/classes being seen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problems with my symbols/classes being seen" Watch "problems with my symbols/classes being seen" New topic
Author

problems with my symbols/classes being seen

Rob Herm
Greenhorn

Joined: Sep 18, 2003
Posts: 2
2 directories setup
F:\Java_Projects\inttest1
I have a file called integertest.java in this directory:
contents are
package inttest1;
public class integertest
{
int [] intarray;
public integertest()
{
intarray=new int[25];
}
void setelement(int i,int j){intarray[i]=j;}
int getelement(int i){return intarray[i];}

}
==========================================================
F:\Java_Projects\inttest2
I have a file called useintegertest.java in this directory

contents are:
package java_projects.inttest2;
import inttest1.*;
public class useintegertest
{

public static void main(String[] args)
{
// Display "Hello World!"
System.out.println("Integer test, Hi Rob!");
integertest itest=new integertest();
}
}
==========
When i goto to compile useintegertest.java .. i get the following errors:
F:\Java_Projects\inttest2\useintegertest.java:3: package inttest1 does not exist
import inttest1.*;
^
F:\Java_Projects\inttest2\useintegertest.java:15: cannot resolve symbol
symbol : class integertest
location: class java_projects.inttest2.useintegertest
integertest itest=new integertest();
^
F:\Java_Projects\inttest2\useintegertest.java:15: cannot resolve symbol
symbol : class integertest
location: class java_projects.inttest2.useintegertest
integertest itest=new integertest();
^
3 errors
Tool completed with exit code 1

Why cant i get the inttest1.*; to be seen .. I've tried all the sensible combinations..
Thanks for the help !
Rob
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
Here are the key things you want to keep in mind:
File one (F:\Java_Projects\inttest1\integertest.java)

File two (F:\Java_Projects\inttest2\useintegertest.java)

Then make sure that "F:\Java_Projects" is in your classpath and you should be able to compile and run just fine. Alternately, if you are in the "F:\Java_Projects" directory, you can make sure that you have "." in your class path.
When you want to run the test, do:
java -cp "C:\Java_Projects" inttest2.useintegertest
Keep in mind that Java is case-sensitive, so whatever package name you use must match the sub-directories exactly.
[ September 18, 2003: Message edited by: Wayne L Johnson ]
Rob Herm
Greenhorn

Joined: Sep 18, 2003
Posts: 2
As far as an editing tool for the source .. i'm using the application called Textpad .. i'm sure you've used it/seen it. Can you set class paths
with it ? .. I looked through everything and did not see a setting where you can list directories to search through .. per project.
I'm sure there are other utilities out there .. can you suggest one ..
otherwise i know of slick edit works well ..
Thanks for the help !
Rob Hermann
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
I'm sure there are other utilities out there .. can you suggest one ..
JBuilder Personal Edition and Eclipse are probably the most popular free IDEs. Check out both, see what you like.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problems with my symbols/classes being seen
 
Similar Threads
Servlet.service() for servlet jsp threw exception java.lang.IllegalStateException
Error compiling SimpleTagSupport class
Pass by ref- pgm err
Error 404: File not found: loadservlet
How do I compile mt Tag Handler...?