Reputation: 1
I have a 202 instructor who says that he feels its fine to use netbeans or eclipse but that for the final project he wants a file that he can load on his xp (I'm not sure why xp) machine, compile and run with the following commands:
javac *.java
java FinalProject
Up to this point I have been editing in a simple text pad like program and missing netbeans but to be fair I can't figure out how to code in netbeans in such a way that I get a generic set of files with no handily added code. If anyone could tell me how to convince netbeans that I don't need packages, ant build, team work software, and a bunch of netbeans helpful files lying around in my code I would really really appreciate it.
Upvotes: 0
Views: 282
Reputation: 11298
First you must get better understanding about IDE. Refer here for NetBeans and Eclipse
When we write a simple program in few lines we can do with notepad and compile with javac. If we go for a big project there are lot of stuff and features required like
In netbeans, you just take "src" folder and use it.
Upvotes: 1
Reputation: 1057
So with netbeans all the source code files get put into a src
directory. This contains nothing other than source files. In order to compile it using javac *.java
you should place all your java files in the <default package>
or without a package(Netbeans will warn that this is bad practice but you can ignore that for now). To run the program using java FinalProject
you need to make a java file called FinalProject.java
(with a class called FinalProject
. You can create any additional classes in external files as long as they all go in the same <default package>
.
Netbeans' scripts will just make it easier for you to compile and test your code. And to submit you just need to submit all the files in the src
folder.
Also, as a side note, If you are creating GUI's using netbeans, you should probably use GridBagLayout
rather than the default layout as that adds an additional library that will mean that your instructor's compilation will fail.
Upvotes: 0