Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-08-2003, 09:57 AM   PM User | #1
Aymen++
Regular Coder

 
Join Date: Nov 2002
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Aymen++ is an unknown quantity at this point
simple .java file

how can i make a simple .java file in JBuilder?
for example a helo world file...
Aymen++ is offline   Reply With Quote
Old 03-08-2003, 04:13 PM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
class HelloWorld{

public static void main(String args[]){

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

}//end main

}//end class
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!

Last edited by Spookster; 03-09-2003 at 02:45 AM..
Spookster is offline   Reply With Quote
Old 03-08-2003, 04:17 PM   PM User | #3
Aymen++
Regular Coder

 
Join Date: Nov 2002
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Aymen++ is an unknown quantity at this point
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?
Aymen++ is offline   Reply With Quote
Old 03-08-2003, 04:23 PM   PM User | #4
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
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.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 03-09-2003, 12:43 AM   PM User | #5
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
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.
Josh Campbell is offline   Reply With Quote
Old 03-09-2003, 02:46 AM   PM User | #6
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Quote:
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.

I fixed it now so you will never know what it was.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 03-09-2003, 04:25 AM   PM User | #7
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
I assumed that someone as skilled as yourself would not have made any typos or errors. j/k
Josh Campbell is offline   Reply With Quote
Old 03-09-2003, 07:58 AM   PM User | #8
Aymen++
Regular Coder

 
Join Date: Nov 2002
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Aymen++ is an unknown quantity at this point
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
Aymen++ is offline   Reply With Quote
Old 03-09-2003, 03:10 PM   PM User | #9
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
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;
Josh Campbell is offline   Reply With Quote
Old 03-09-2003, 06:11 PM   PM User | #10
Aymen++
Regular Coder

 
Join Date: Nov 2002
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Aymen++ is an unknown quantity at this point
i did it!!! and the same problem...
Aymen++ is offline   Reply With Quote
Old 03-09-2003, 08:13 PM   PM User | #11
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
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
Josh Campbell is offline   Reply With Quote
Old 03-09-2003, 09:25 PM   PM User | #12
Aymen++
Regular Coder

 
Join Date: Nov 2002
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Aymen++ is an unknown quantity at this point
Ok thank you very much, but where can i see the output of my project?
Aymen++ is offline   Reply With Quote
Old 03-09-2003, 09:44 PM   PM User | #13
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
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.
Josh Campbell is offline   Reply With Quote
Old 03-13-2003, 09:33 PM   PM User | #14
mattyb
New Coder

 
Join Date: Mar 2003
Location: Canada eh.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
mattyb is an unknown quantity at this point
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
__________________
"Me work..... There is as much chance of that happening as there is of the world ending as you read this!"
mattyb is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 04:27 PM.


Advertisement
Log in to turn off these ads.