Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > NetBeans and JCreator

Reply
Thread Tools

NetBeans and JCreator

 
 
Lew
Guest
Posts: n/a
 
      02-24-2007
"SBC News" wrote:
> I've been using 'default package' sine I thought it default to NetBeans.
> So what you're saying is when I create a new project in NetBeans, I should
> give it a package name, so it does not create .java file in the 'default
> package', right?


Not really.

First of all, the "default package" is a /Java/ concept, not Netbeans. It
means a class that is not part of any package. It is for quick and dirty "toy"
classes, not for real work.

Second of all, "it" does not create .java files, /you/ create .java files.
Those are the source files that the programmer writes. The javac compiler
program then creates .class files from those.

Third of all, you don't "give [a project] a package name", you put individual
classes in packages. Packages organize and provide structure to groups of
classes, and have important consequences to method and instance variable
visibility. Consider, for example, the notion of "package-private", or
"default" access.

Fourth of all, these are fundamental notions to Java programming, and are a
little confusing because they relate to the directory structure where the
..java and .class files reside. It will give you large dividends to study the
Sun Java tutorial on the notions of classes and packages.

- Lew
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      02-24-2007
SBC News wrote:
> what I did was in NetBeans' File -> Open File and select my .java file.
> It opened the file but all of the Compile/Run icons/options are grayed out.
>
> However, since the post, I did try to create empty project in NetBeans;
> then, copied the content of my .java file and pasted in the new project file
> and it compiled/ran o.k.
>
> I'm O.K. now in a sense that I can work around, but still want to know why
> NetBeans behaved like this, though. I'm hoping you or someone that have more
> experiences in this field can point out the obvious. If not, I have to do it
> this way in the future.


It was mentioned that Netbeans, indeed any Java compiler and executor, needs
to know the classpath to compile and run a file. When you just open a file in
Netbeans, you do not tell it any of that information. When you set up a
project, that process tells Netbeans where the Java resources are.

(See David Segall's response, for example.)

A: Because it makes posts so dang hard to read.


Q: Why is it bad?


A: Placing answers above the questions you're answering, like this.


Q: What is top posting?


Please do not top post.

Note that you were given a link about the term, and GIYF, and Wikipedia has
just about everything in it.

- Lew
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.util.Formatter and JCreator Michael B. Williams Java 6 10-22-2004 07:13 AM
jcreator IDE Jeremy Watts Java 4 09-09-2004 12:09 PM
JCreator too slow Thanasis \(sch\) Java 3 01-30-2004 11:20 PM
JCreator Chinese Language Support terry Java 0 09-14-2003 12:23 PM
JCreator Pro 2.5 Build 8 and Debugger facilities Guy Van Rinsveld Java 0 08-03-2003 05:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57