java.lang.NoClassDefFoundError: src/myproject/myapp (wrong name: myproject/

Hi

I was trying to build an app using JBuilder personal. It would build and run fine. Then i realised that i could not use the api from jdk1.4 as JBuilder would only work with jdk1.3.

So, i moved the project from JBuilder to Forte thinking that Forte would allow me to use the jdk1.4 api. After significant trouble porting the project, i got the project to build successfully.

But when i try to run it , i get the following error

What could be causing it and how do i fix it? these errors are very frustrating. searching this site or the forte help, hasnt given me any tips yet. Thanks

java.lang.NoClassDefFoundError: src/myproject/myapp (wrong name: myproject/myapp )

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:486)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)

at java.net.URLClassLoader.access$100(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:297)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)

at java.lang.ClassLoader.loadClass(ClassLoader.java:253)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)

Exception in thread "main"

[1557 byte] By [3libras] at [2007-9-26 3:09:43]
# 1
Hi ,Its very simple, the path not specified properly, you have created a class under the package name...so, set the classpath ...hope it'll help you..ramesh
rameswar at 2007-6-29 11:15:41 > top of Java-index,Developer Tools,Java Compiler...
# 2

Hi ramesh, thanks for responding.

my CLASSPATH seems to be set correctly. am using Win2K.

I just tried running the app from the DOS prompt

i.e >java myapp

and it RAN!!!! :)

But when i try to run from Forte, it still gives the same dumb errors ..

Could it be a Forte settings problem?

ai-yai yai..

easy to develop IDE = MORE apps !

3libras at 2007-6-29 11:15:41 > top of Java-index,Developer Tools,Java Compiler...
# 3

[3libras],

Forte for Java is not completely tested with J2SE SDK 1.4 yet as the 1.4 is still in the BETA stage.

The current officially supported version of the SDK is J2SE 1.3 for the current release of Forte for Java 2.0.

HTH.

Allen Lai

SUN Developer Technical Support

allenlai at 2007-6-29 11:15:41 > top of Java-index,Developer Tools,Java Compiler...
# 4
set the class path before running forte, also wait until java 1.4 leaves beta. BETA= may contain bugs!!!So, if it dosen't work you have a bug fix, not a simple question.
musheno at 2007-6-29 11:15:41 > top of Java-index,Developer Tools,Java Compiler...
# 5
may be the 'name file' of the location where u ran it....perhaps....name sensitive case?regards,kurt
rojaktambi at 2007-6-29 11:15:41 > top of Java-index,Developer Tools,Java Compiler...
# 6

> But when i try to run from Forte, it still gives the same dumb errors ..

> Could it be a Forte settings problem?

Definitely. Choose the Project menu, then the Settings... at the bottom. That brings you up a new dialog. On the left, select the "Execution types", and the "external execution" within. On the right pane, click on the "expert" tab on the bottom. There you have a field named classpath; add your classpath directories there. Then your program will probably run from Forte.

For compiling, you also should set the classpath; you need "Compiler types" on the left pane, and you have to set the classpath for the fastJavac compilation and/or for the external compilation, depending which one you use.

On the left also a "Java Sources" node - click on it, and check if the "default compilation" is either external or (preferable) fastJavac; and that the default execution is external.

How Forte works with internal compilation, and internal execution, I don't know, never tried that.

Best Regards,

Ivan

ivanhu at 2007-6-29 11:15:41 > top of Java-index,Developer Tools,Java Compiler...