Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

NetBeans and JCreator

 
 
SBC News
Guest
Posts: n/a
 
      02-22-2007
Hello Guru,

I'm new with Java and have a question regarding NetBeans and JCreator compatibility.

I have a Window Application program that I wrote using JCreator Pro 4.0.
The program is compiling and running fine in JCreator Pro 4.0.

However, when I open the file in NetBeans, I don't have any way to compile/run the .java file.
Is there a way that I can make the file works on both IDE environments?
Or NetBeans just doesn't accept .java files that's not created using NetBeans?

Thanks,
PETER NGUYEN
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      02-23-2007
SBC News wrote:
> Hello Guru,
>
> I'm new with Java and have a question regarding NetBeans and JCreator
> compatibility.
>
> I have a Window Application program that I wrote using JCreator Pro 4.0.
> The program is compiling and running fine in JCreator Pro 4.0.
>
> However, when I open the file in NetBeans, I don't have any way to
> compile/run the .java file.
> Is there a way that I can make the file works on both IDE environments?
> Or NetBeans just doesn't accept .java files that's not created using
> NetBeans?
>
> Thanks,
> PETER NGUYEN


Please post plain-text messages, not HTML, to newsgroups.

- Lew
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      02-23-2007
SBC News wrote:
>> I'm new with Java and have a question regarding NetBeans and JCreator
>> compatibility.
>>
>> I have a Window Application program that I wrote using JCreator Pro 4.0.
>> The program is compiling and running fine in JCreator Pro 4.0.
>>
>> However, when I open the file in NetBeans, I don't have any way to
>> compile/run the .java file.
>> Is there a way that I can make the file works on both IDE environments?
>> Or NetBeans just doesn't accept .java files that's not created using
>> NetBeans?


NetBeans generally does not have trouble with .java files that come from
"outside" its environment. What error(s) do you get when you try to compile or
run your program?

Java is a very portable language, and programs written in one environment will
work in the same revision level of Java pretty much anywhere (matters like JNI
excepted). They also mostly work in later versions than where they originated.
So if your program won't compile or run, there is a specific problem not
related to whether "NetBeans just doesn't accept .java files", because it does.

It is hard to give good advice without specific information.

- Lew
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      02-23-2007
On Feb 23, 9:29 am, "SBC News" <(E-Mail Removed)> wrote:
...
> I'm new with Java and have a question
> regarding NetBeans and JCreator compatibility.


Lew made some good points. In addition
to those, I will simply add that since
JCreator seems to offer Ant support,
making an Ant based JCreator project
might be a good way to make code portable
between JCreator, NetBeans, Eclipse..
and even environments where people use
'TextPad and Ant'.

Andrew T.

 
Reply With Quote
 
SBC News
Guest
Posts: n/a
 
      02-23-2007
Thanks Lew,

There is no error.
It just simple does not give me the option to compile or run the .java file.
All of the compile and run command are grayed out.

I can run the .class file (compiled with JCreator) from command line fine.
I just want to make sure if I send the source code to my friend who uses
NetBeans and he can compile/run my .java code.

Thanks,
PETER NGUYEN

"Lew" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed). ..
> SBC News wrote:
>>> I'm new with Java and have a question regarding NetBeans and JCreator
>>> compatibility.
>>> I have a Window Application program that I wrote using JCreator Pro
>>> 4.0.
>>> The program is compiling and running fine in JCreator Pro 4.0.
>>> However, when I open the file in NetBeans, I don't have any way to
>>> compile/run the .java file.
>>> Is there a way that I can make the file works on both IDE environments?
>>> Or NetBeans just doesn't accept .java files that's not created using
>>> NetBeans?

>
> NetBeans generally does not have trouble with .java files that come from
> "outside" its environment. What error(s) do you get when you try to
> compile or run your program?
>
> Java is a very portable language, and programs written in one environment
> will work in the same revision level of Java pretty much anywhere (matters
> like JNI excepted). They also mostly work in later versions than where
> they originated. So if your program won't compile or run, there is a
> specific problem not related to whether "NetBeans just doesn't accept
> .java files", because it does.
>
> It is hard to give good advice without specific information.
>
> - Lew



 
Reply With Quote
 
David Segall
Guest
Posts: n/a
 
      02-23-2007
"SBC News" <(E-Mail Removed)> wrote:

>Hello Guru,
>
>I'm new with Java and have a question regarding NetBeans and JCreator compatibility.
>
>I have a Window Application program that I wrote using JCreator Pro 4.0.
>The program is compiling and running fine in JCreator Pro 4.0.
>
>However, when I open the file in NetBeans, I don't have any way to compile/run the .java file.
>Is there a way that I can make the file works on both IDE environments?
>Or NetBeans just doesn't accept .java files that's not created using NetBeans?

Netbeans can be used with Java files from any source but it likes to
arrange the directories in a "project" and write an Ant script to
control the project. You can compile and run individual files in a
project but you would normally compile and run the project.

Did you use the Wizard from the "New Project" menu to start a
"General" "Java Project with Existing Sources"? The items in quotes in
the previous sentence are from the menus and tabs you need to use. If
you successfully filled in the fields the Wizard asked you for, what
happened when you tried to run the project?
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      02-23-2007
SBC News wrote:
> Thanks Lew,


Please do not top post.

> There is no error.
> It just simple does not give me the option to compile or run the .java file.
> All of the compile and run command are grayed out.
>
> I can run the .class file (compiled with JCreator) from command line fine.
> I just want to make sure if I send the source code to my friend who uses
> NetBeans and he can compile/run my .java code.


You probably need to set up a project for Netbeans to know the class path to
the .java file, and where to put the compiled bytecode.

I have a project in my Netbeans set up for all kinds of "misc"ellaneous java
files. When I want to run a single class, I stick it in a package within that
project.

Don't forget that any Java compiler or execution has to be aware of the
package structure. Avoid use of the default package.

- Lew
 
Reply With Quote
 
SBC News
Guest
Posts: n/a
 
      02-24-2007
Hello David and All,

No, 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.

Thank you all for your responses!
PETER NGUYEN


"David Segall" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "SBC News" <(E-Mail Removed)> wrote:
>
>>Hello Guru,
>>
>>I'm new with Java and have a question regarding NetBeans and JCreator
>>compatibility.
>>
>>I have a Window Application program that I wrote using JCreator Pro 4.0.
>>The program is compiling and running fine in JCreator Pro 4.0.
>>
>>However, when I open the file in NetBeans, I don't have any way to
>>compile/run the .java file.
>>Is there a way that I can make the file works on both IDE environments?
>>Or NetBeans just doesn't accept .java files that's not created using
>>NetBeans?

> Netbeans can be used with Java files from any source but it likes to
> arrange the directories in a "project" and write an Ant script to
> control the project. You can compile and run individual files in a
> project but you would normally compile and run the project.
>
> Did you use the Wizard from the "New Project" menu to start a
> "General" "Java Project with Existing Sources"? The items in quotes in
> the previous sentence are from the menus and tabs you need to use. If
> you successfully filled in the fields the Wizard asked you for, what
> happened when you tried to run the project?



 
Reply With Quote
 
SBC News
Guest
Posts: n/a
 
      02-24-2007
Hello Lew,

That is interesting.
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?

--
PETER NGUYEN
"Lew" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed). ..
> SBC News wrote:
>> Thanks Lew,

>
> Please do not top post.
>
>> There is no error.
>> It just simple does not give me the option to compile or run the .java
>> file.
>> All of the compile and run command are grayed out.
>>
>> I can run the .class file (compiled with JCreator) from command line
>> fine.
>> I just want to make sure if I send the source code to my friend who uses
>> NetBeans and he can compile/run my .java code.

>
> You probably need to set up a project for Netbeans to know the class path
> to the .java file, and where to put the compiled bytecode.
>
> I have a project in my Netbeans set up for all kinds of "misc"ellaneous
> java files. When I want to run a single class, I stick it in a package
> within that project.
>
> Don't forget that any Java compiler or execution has to be aware of the
> package structure. Avoid use of the default package.
>
> - Lew



 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      02-24-2007
On Feb 24, 11:05 am, "SBC News" <(E-Mail Removed)> wrote:
> Hello Lew,
>
> That is interesting.


What is?

Note that Lew also said..

> > Please do not top post.


More information here..
http://www.physci.org/codes/javafaq.html#netiquette

Andrew T.

 
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