Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

NetBeans: Single file compilation doesn't work

Thread view: 
palun - 10 Apr 2006 18:16 GMT
Sorry to bother you with this. I tried posting it to
c.l.j.softwaretools, but there seems to be very little happening there...

My problem:
I am trying to compile and run a single test-file in NetBeans 5. The
file is located in a separate test-tree (under src/test), and has
references to two other classes located in the main source tree
(src/main). (These, in turn, uses only java standard api classes.)

When I try "Compile file" (right mouse button menu, or F9) on the file,
the compiler insists on compiling not just my test file, but all files
in the project(!) - Why is this?

It seems single file compilation works fine for files in the main source
tree, but fails in the test tree. (Both trees have identical package
hierarchies. And both are recognized as containing source.)

Can someone please explain to me what is happening?

Thanks,
/ulf (who should have stuck with Eclipse)

PS. I couldn't find anything on the NetBeans fora (which btw are full of
questions without answers...)
Oliver Wong - 10 Apr 2006 20:45 GMT
> Sorry to bother you with this. I tried posting it to c.l.j.softwaretools,
> but there seems to be very little happening there...
[quoted text clipped - 20 lines]
> PS. I couldn't find anything on the NetBeans fora (which btw are full of
> questions without answers...)

   By "test file", are you referring to JUnit tests?

   Maybe NetBeans doesn't do progressive compilation the way Eclipse does.
I don't know, not familiar with NetBeans.

   - Oliver
Thomas Kellerer - 11 Apr 2006 08:13 GMT
> Sorry to bother you with this. I tried posting it to
> c.l.j.softwaretools, but there seems to be very little happening there...
[quoted text clipped - 8 lines]
> the compiler insists on compiling not just my test file, but all files
> in the project(!) - Why is this?
This is a known bug with the "Compile single" task. I think there is one
file in the NetBeans bug tracker.

As the whole thing is Ant-Based you can probably override the
compile-single task in the build.xml of your project to call the
necessary task to build all modified sources first.

Thomas


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.