Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problems with my symbols/classes being seen

 
Rob Herm
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic