• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problems with my symbols/classes being seen

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic