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 181891 - Single Source File Mode
Summary: Single Source File Mode
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-11 17:59 UTC by linez
Modified: 2010-03-15 14:57 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description linez 2010-03-11 17:59:06 UTC
Dear Netbeans Developer ; 

I am java developer and I have been using Netbeans long for time.

It is full of tools that helps developer to make a high quality applications.

but 

when it comes to compile single source code file that is(not part of a project)
it takes me a many steps to do that enforcing me to make a new project then put that source inside it to get my job done. and this is tedious extra work not needed . especially when I have piece of code that I want to test a just check its output ! 

what I want is to let the user to choose between Project mode and Source File mode where he can just open the source and compile it directly without making a new project or just allow that in netbeans in general. 

A good example of that is a software called Jcreator.


So why we assume all developer are same some of them are learning and at the beginning of programming and what they want is just to test their code if it is correct or not. 

Also, there are other members issue same problem in cummunity section . 
this is one of them : 
http://www.velocityreviews.com/forums/t149529-compile-java-using-netbeans.html


I hope that you consider this issue. And thank in advanced.

regards ;
Comment 1 Jesse Glick 2010-03-11 19:39:47 UTC
Probably there could be an ActionProvider.RUN_SINGLE fallback binding for naked Java sources using JavaRunner, much as there is for *.sql and *rb. Would only work for files using no classes outside the JRE, of course. And only if they either had no package declaration, or were already in a matching package structure.
Comment 2 linez 2010-03-13 11:41:07 UTC
(In reply to comment #1)
> Probably there could be an ActionProvider.RUN_SINGLE fallback binding for naked
> Java sources using JavaRunner, much as there is for *.sql and *rb. Would only
> work for files using no classes outside the JRE, of course. And only if they
> either had no package declaration, or were already in a matching package
> structure.

Hello Jeese ;

Thanks for fast respond. 

As I said you are assuming that I will have that big java programme that I need to use in term of packages thus I need to make a new project ... 

What I want is simple that is to make me able to compile and run any source file without the bother of making new project , extra overhead and extra not needed files generated . 

If you want an example look at JCreator at www.jcreator.com
and JGrasp at www.jgrasp.org

regards ;
Comment 3 Tomas Zezula 2010-03-15 14:57:15 UTC
OK, can be added. The question is what to add in the classpath. It should be probably consistent with DefaultClassPathProvider which adds all ClassPath.COMPILE registered in the GlobalPathRegistry. JavaRunner will differ from the CoS one as there is no cache for no project sources. The Cos JavaRunner  just copies the class file the new JavaRunner will need to do the compilation.