This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 146168 - Compile on Save uses java file location instead of package declaration
Summary: Compile on Save uses java file location instead of package declaration
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 166307 (view as bug list)
Depends on:
Blocks: 152191
  Show dependency tree
 
Reported: 2008-09-04 12:38 UTC by Petr Dvorak
Modified: 2009-11-02 12:34 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project (11.65 KB, application/x-gzip)
2008-09-04 12:38 UTC, Petr Dvorak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Dvorak 2008-09-04 12:38:06 UTC
Product Version: NetBeans IDE Dev (Build 200809021401)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

COS uses a java file location instead of package declaration for execiting files...

To reproduce:

0. Start IDE
1. Open sample project from TS_60_JavaEditor and assure COS is enabled
2. Open class OpenFile.java
3. Try to run this file ("Run File" from the editor's popup menu)
-> failure:

java.lang.NoClassDefFoundError: test/OpenFile
Caused by: java.lang.ClassNotFoundException: test.OpenFile
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: test.OpenFile.  Program will exit.
Exception in thread "main" Java Result: 1

4. Disable COS for the project
5. Try to run file OpenFile.java again
-> success
Comment 1 Petr Dvorak 2008-09-04 12:38:52 UTC
Created attachment 69043 [details]
sample project
Comment 2 Jiri Prox 2009-06-08 11:20:43 UTC
*** Issue 166307 has been marked as a duplicate of this issue. ***
Comment 3 Dusan Balek 2009-09-30 09:49:44 UTC
Should be fixed in the current dev build.
Comment 4 Petr Dvorak 2009-11-02 12:34:37 UTC
Yes, it works in the 68Beta => Verified