[1833] in java-interest

home help back first fref pref prev next nref lref last post

Re: Importing Classes into Applications

daemon@ATHENA.MIT.EDU (Thomas Ball)
Mon Sep 18 17:24:18 1995

Date: Mon, 18 Sep 1995 11:19:14 -0700
From: Thomas.Ball@Eng.Sun.COM (Thomas Ball)
To: gec2@Ra.MsState.Edu
Cc: java-interest@java.Eng.Sun.COM

Package declarations are mapped to directories, so the compiler is
looking for "./crawford/prata_project/Stock.*", not "./Stock.*".  The
easiest way I've found to deal with that (on Unix) is to create a link
back to my current directory, something like:

	mkdir crawford
	cd crawford
	ln -s .. prata_project

It's just a hack, but it beats constantly changing directories when
first creating a new project.  Once it's more stable (or when giving
it out), replace the link with the actual directory and move the .java 
source files there.

Tom

>  From daemon@java  Mon Sep 18 10:38:52 1995
>  To: java-interest@java
>  Subject: Importing Classes into Applications
>  X-Info: To unsubscribe, send 'unsubscribe' to java-interest-request@java.sun.com
>  
>  
>   I have a class (called Stock) that I'd like to import into another class
>   (StockTest).
>   
>   In class Stock, I have the following package statement:
>   package crawford.prata_project;
>   
>   In class StockTest (which is to use an instance of class Stock), I have:
>   import crawford.prata_project.Stock;
>   
>   I have successfully compiled Stock.java. When I try to compile StockTest.java,
>   I get the following error:
>   Class crawford.prata_project.Stock not found in type declaration.
>   
>   I compiled StockTest.java by simply typing: javac StockTest.java
>   
>   I even tried setting CLASSPATH. 
>   
>   Any help is greatly appreciated,
>   George
>   
>  
>  -
>  Note to Sun employees: this is an EXTERNAL mailing list!
>  Info: send 'help' to java-interest-request@java.sun.com
>  
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post