Error: "package hep.aida does not exist"

Hi,

I am trying to run a code written in Java that a friend gave me.

The code starts with:

import hep.aida.*;

Upon compiling the file, the following error message appears:

C:\Program Files\netbeans-5.0\work\FitFrame\src\FitFrame.java:15: package hep.aida does not exist

import hep.aida.*;

The path for my extension repertory is:

java.ext.dirs: C:\Program Files\Java\jdk1.5.0_07\jre\lib\ext

and the package hep.aida is in the following repertory:

C:\Program Files\Java\jdk1.5.0_07\jre\lib\ext\freehep\hep\aida

and therfore is contained in the extension repertory.

import freehep.hep.aida.*; returns the same error message.

I compile the file using NetBeans IDE 5.0.

Can someone tell me what is wrong here and how exactly I can fix this problem? Your help would be greatly appreciated!!

Thanks in advance,

Ciao

Gilles

[960 byte] By [gjbenoita] at [2007-10-3 2:26:03]
# 1
I don't believe that the VM will recurse through sub directories in 'ext'.If it doesn't then it isn't going to find the jar where you put it.
jschella at 2007-7-14 19:25:06 > top of Java-index,Java Essentials,New To Java...
# 2

If you want to put some classes into the extensions directory (which isn't an especially good idea in many cases) then there are two requirements:

1. The classes have to be in a jar file (not loose classes)

2. The jar file has to be in the .../jre/lib/ext directory (not in any subdirectory)

Be warned that when you compile classes and when you run classes, you may be using different copies of the JRE and hence different extension directories, so make sure the jar file is in both places. And when you install a new version of the JRE, make sure you copy the jar files over into the extensions directories of the new JREs.

DrClapa at 2007-7-14 19:25:06 > top of Java-index,Java Essentials,New To Java...
# 3
Thanks for your answer! In general then, where is the best location to store packages/classes (like freehep, hep, colt...) and how do I ensure that the path is recognized when I compile my code? (sorry if this sounds like a trivial question; I am really new to this). Thanks!
gjbenoit1a at 2007-7-14 19:25:06 > top of Java-index,Java Essentials,New To Java...
# 4

> Thanks for your answer! In general then, where is the

> best location to store packages/classes (like

> freehep, hep, colt...)

You provide an explicit classpath on the command line for each application.

Generally each application will be in a directory and the relevant jars will be in that directory or perhaps a directory below that.

> and how do I ensure that the

> path is recognized when I compile my code? (sorry if

> this sounds like a trivial question; I am really new

> to this). Thanks!

You mean class path.

During compilation it will tell you if a class is not found. When you get that error it means something is wrong with your classpath.

jschella at 2007-7-14 19:25:06 > top of Java-index,Java Essentials,New To Java...