Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Forte IDE Problem - Running/Debuggin packed classes

  Asked By: Armando    Date: May 27    Category: Java    Views: 770

I'm in trouble ... I have some classes with package declaration
(package br.com.netset.app.FaturamentoBanrisul) .. when compiling
after properly configuration inside the SUN ONE Studio (formely
Forte4Java) the directorie tree was created and my .class files
created too.

But to run or debug the IDE try to execute my main Class for the
project from the <default package> (same directory/class name) and do
not recognize my package declaration.

I really tried but can't find the property to say my root directorie
for that project ...



3 Answers Found

Answer #1    Answered By: Sheryl Morgan     Answered On: May 27

In SunOne Studio, (formely Forte) you mounted a directory of your system
to in the "Explorer" right. Your main class  should be outside the
package declaration  to be able to run  it. Example:

Case:: Main.class is in C:\Temp Directory, and I have a package  say

1. I will mount C:\Temp in the explorer
2. I will copy package folder INSIDE C:\Temp
3. I will write import statements as usual and Forte will take care of

Second Method::

1. Set your classpath accordingly, from Tools > Options > Choose
Building > Comiler Types and set Classpaths from advanced tab

Third Method:

If you are switching IDEs frequently, one way is to copy your JAR files
or other objects in JDK\ JRE\ LIB\ EXT Directory, they will be imported

Answer #2    Answered By: Brian Ross     Answered On: May 27

Your examples and situations are OK to get the import instruction
running ... but this is not my problem.

I have several pakages and the root  directory for them is on my
CLASSPATH .. the javac can find  them and import anyone (inside Forte
or on command line - equaly)

My problem  is to run  or DEBUG from Forte .. because it is looking for
my class  on my source directory (that is far diferent from my package
tree) and then I have "java.lang.NoClassDefFoundError:
Exception in thread "main"" error.
(same error as I have called java command line with an inexistent

I added my path to CLASSPATH on Debugger Execution and External
Execution options but no difference ...

Any thought?

Answer #3    Answered By: Heidi Larson     Answered On: May 27

Ok, please tell me do you get the same error while Running the same
application from command prompt with "java ...." . I think you have some
classes or objects that invokes their functions at runtime, and hence
you can compile but not run  your application. Try this solution::

1. Make a simple executable class  and name it "Trial.java" at the same
location you have your source files. From onwards I will call this class
2. In Trial class make an object of your class for which you are
receiving .NoClassDefFoundError, and invoke its any public method.
Assume this object as "Child"

3. Now since, this is just a trial class try Import statements or
Classpath settings from Forte and test on it. It should execute  your
"child" objects method.
4. When you again receive an error:: Try to relocate your "Child" (by
copying) Class on different locations I mention in earlier mail and
"Adding" them to your classpath.

NOTE:: Its a one time exercise after that you will definately learn
setting classpath in Forte. This is not an official method, Its my own
discovery while working with different IDEs.

NOTE2:: Whenever you use any ide  say Oracle JDeveloper 9i or SunOne
Studio (specially for GUI apps), always test your applications on system
with Sun's JDK without installing these IDEs. At the end you will
execute your application from "Outside" of IDE, isn't it?

Didn't find what you were looking for? Find more on Forte IDE Problem - Running/Debuggin packed classes Or get search suggestion and latest updates.