1

So I created a project in netbeans and then added a new JFrame form (this is my first gui app). I was wondering if there was any way to open the source code in another app like textedit and compile it using terminal (javac blah.java, java blah).

I managed to create a .jar file (clean and build) and it works perfectly fine when I try to run it (double click). Now I managed to find the .java file in src but when I compile it I receive 36 errors, which makes no sense since it built and ran perfectly fine and the jar file works.

Essentially I want to just take the source code (not the entire project) and compile it, for example on a computer that does not have netbeans using terminal. Can this be done?

I would also like to emphasize that I'm just a beginner. Thanks!

user2545067
  • 15
  • 1
  • 3
  • Hopefully, this [example](http://stackoverflow.com/a/15187181/1057230) and this [example](http://stackoverflow.com/a/17745494/1057230) might be able to guide you in a good way. Though you have to first check, if `java` lies on your `path` variable, as shown [here](http://stackoverflow.com/a/8712087/1057230). If still unclear please respond back, with your OS, we will try to give detailed information :-) – nIcE cOw Aug 04 '13 at 06:15
  • Moreover, if you using `Windows OS` you can follow these [steps](http://gagandeepbali.uk.to/gaganisonline/webpages/helloworld.html), to add `Java` to your path variable. – nIcE cOw Aug 04 '13 at 06:30

2 Answers2

0

Standard NetBeans projects are based on Apache Ant. So it should be sufficient to install Ant and a JDK to compile/package your project on another computer or CI system.

Ben
  • 2,235
  • 18
  • 17
0

What i found to be the culprit to this problem is that on your source code make sure it does not have package. So for example: "package blablah"

All you have to do is get rid of that, and then take your java file and it should compile perfectly. For some reason that causes the nodefclass error.

Uknown
  • 1