aspose file tools*
The moose likes Applets and the fly likes package error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "package error" Watch "package error" New topic
Author

package error

Akash Khandelwal
Greenhorn

Joined: Dec 23, 2005
Posts: 3
Hi all:

I have a source code for java applet which I want to modify. The code was written by someone else and now they have left. But before I modify anything I thought I should just try to just recompile the *.java files and see what happens. The applet contains 5 packages and each package contains 3-4 classes. The class from one package can use class from other package. I can see from the code that there is import statement. When I tried to compile one of the *.java file in a package. I got the following error message:

�C:\pharsimu\gui\ModelPanel.java:3: package pharsimu.generic does not exist
import pharsimu.generic.DoubleLabelSlider; �

Is this error due to CLASSPATH or something else. I haven�t set my CLASSPATH because I don�t know how to do that. I am using text pad to recompile and am new to java.

Can anyone help me???


Thanks

Akash
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42930
    
  68
Hello Akash-

Welcome to JavaRanch.

You have several options. Either you could compile all files in one go, in which case the compiler would figure out what to do correctly. E.g., if you are in "C:\", do a

javac harsimu\gui\*.java harsimu\generic\*.java harsimu\...\*.java etc. etc.

Or you could try to figure out in which order the packages rely on one another, and compile those without dependencies first. In this case it looks like you'd need to compile the generic package before you compile the gui package.

And you should always be in the "C:\" directory when you issue the javac commands, because that's the root of the classpath hierarchy, and things will work without you setting the classpath explicitly.
Akash Khandelwal
Greenhorn

Joined: Dec 23, 2005
Posts: 3
well i was trying as u suggested but was not successful because of the number of characters that can be typed in a line in DOS prompt. Is there any way to do in textpad?
Thanks
Akash
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42930
    
  68
Textpad is an editor; you can't use it to issue DOS commands (unless you want to use it to write a shell script that does the compiling).

How does the DOS prompt not allow you to use the javac command? It can accommodate very long commands; what does the javac command you're trying to use look like?
Akash Khandelwal
Greenhorn

Joined: Dec 23, 2005
Posts: 3
please disregrard my previous message. when i issued the javac command in dos prompt i am getting the following error message. I guess there is some problem with the set up.
-----------------------------------------------------------------------
'javac' is not recongnized as an internal or external commmand, operable program or batch file.
--------------------------------------------------------------------
This was the command i was issuing in dos prompt in C:\
javac pharsimu\compute\*.java pharsimu\data\*.java pharsimu\event\*.java pharsimu\gui\*.java pharsimu\generic\*.java pharsimu\main\*.java
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42930
    
  68
That means that the directory containing the java executables (javac, java, jar, ...) is not part of your PATH. So you either need to specify the full path to the executables (which is a real drag), or add that directory to your PATH system environment variable. On a Windows machine, the path would be something like "C:\j2sdk1.4.2\bin" (depending on where you installed the JDK).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: package error