Helpful Information
 
 
Category: Java and JSP
simple .java file

how can i make a simple .java file in JBuilder?
for example a helo world file...

class HelloWorld{

public static void main(String args[]){

System.out.println("Hello World");

}//end main

}//end class

no, i didn't mean that, i meant how to make new file (.java) in JBuilder.
for more illustration: where should i copy and paste this code?

Well you could read the help files that come with it. Been a few years since I used it but you should create a New Project and then add a java source file to it. Can't remember all the menu choices.

First make a new project, File -> New Project. Then just follow the wizard to set it up. Then make a new class File -> New Class and also follow its wizard. Make sure the name of the class is the same as .java (HelloWorld if you use the code spook provided). Then to compile your project goto Project -> Make Project and then Run -> Run Project to run it.

Originally posted by Josh Campbell
if you use the code spook provided)

I had a typo in that code and you didn't catch it. Shame shame. :D

I fixed it now so you will never know what it was.

I assumed that someone as skilled as yourself would not have made any typos or errors. :D j/k

but when i choose run a dialog box named project properties will apear...
i choosed new from that dialog, another dialog will apear, then i made the main class: HelloWorld.HelloWorld, then i clicked ok to close this dialog, after that i clicked run and this error appeared to me:
Could not find the main method. Program will exit!
Why:confused:

Make sure you chose application as type and that you have the package setup correctly. Whenever you paste in spook's code, keep the thing that says package HelloWorld;

i did it!!! and the same problem...

Ok heres the process again, this works for me

1. File -> New Project
2. Name your project then press finish
3. File -> New Class
4. Name your class then press finish
5. Copy and paste spook's code, remembering to keep package thing in there
6. Project -> Make Project
7. Run -> Run Project
8. Click New
9. Choose Application as type
10. Choose the class you just made as main class.
11. Run -> Run Project

Ok thank you very much, but where can i see the output of my project?

Output using System.out is displayed in the bottom text area thing, right below where the classpath and the call to the java interpreter are displayed.

Hmmm. I use ready to program in Java from Holt software it's cool but sometimes a little buggy. Still I prefer over Jbuilder.

The Bee










privacy (GDPR)