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 02-12-2008, 03:19 AM   PM User | #1
binaryWeapon
Regular Coder

 
Join Date: Sep 2007
Location: AZ, USA
Posts: 685
Thanks: 6
Thanked 46 Times in 46 Posts
binaryWeapon is on a distinguished road
Intro to Java

Alright, I've had some trouble with trying to learn java in the past, mainly installing and using the tools that Sun Micro provides. I have found some pretty good tutorials, although if anyone thinks they know a phenomenal one feel free to mention. The main thing I'm looking for is a good, straight java compiler. I don't need a fancy-shmancy IDE, just a simple debugger/compiler.

I just need to be pointed in the right direction; I have big plans for java and my webpage.
binaryWeapon is offline   Reply With Quote
Old 02-12-2008, 05:06 AM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
I prefer Eclipse for developing java. You will need the JDK. Do a search on how to setup the environmental variables for java. After doing that successfully you can run java from the command line or use eclipse. Eclipse is good for debugging. Good tutorial here on getting java setup on your system.

http://www.javacoffeebreak.com/tutor...ted/index.html
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 02-12-2008, 02:19 PM   PM User | #3
binaryWeapon
Regular Coder

 
Join Date: Sep 2007
Location: AZ, USA
Posts: 685
Thanks: 6
Thanked 46 Times in 46 Posts
binaryWeapon is on a distinguished road
Thank you, it appears to be just what I've been looking for. However, I can't seem to debug or run any programs. I have my code:

Code:
public class Helloworld
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
in a .java file. I try to run it and I get an error
Quote:
The selection could not be launched, and there are no recent launches.
Do you happen to know what's wrong?
binaryWeapon is offline   Reply With Quote
Old 02-12-2008, 04:30 PM   PM User | #4
shyam
Senior Coder

 
shyam's Avatar
 
Join Date: Jul 2005
Posts: 1,563
Thanks: 2
Thanked 163 Times in 160 Posts
shyam will become famous soon enough
how did you run the program? Alt+Shift+X, J ?
__________________
You never have to change anything you got up in the middle of the night to write. -- Saul Bellow
shyam is offline   Reply With Quote
Old 02-12-2008, 11:55 PM   PM User | #5
binaryWeapon
Regular Coder

 
Join Date: Sep 2007
Location: AZ, USA
Posts: 685
Thanks: 6
Thanked 46 Times in 46 Posts
binaryWeapon is on a distinguished road
CTRL-F11, (menu bar) > Run > Run
Is that right? I mean, should I be doing it a different way?
binaryWeapon is offline   Reply With Quote
Old 02-13-2008, 03:12 AM   PM User | #6
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
What program are you using to run the file? Did you setup your environmental variables? Have you tried using the command line to verify that everything is working properly. READ the whole tutorial, not just bits and pieces.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 02-13-2008, 03:59 PM   PM User | #7
brad211987
Regular Coder

 
brad211987's Avatar
 
Join Date: Sep 2005
Location: Ohio
Posts: 631
Thanks: 10
Thanked 50 Times in 50 Posts
brad211987 is an unknown quantity at this point
In Eclipse, right click on your .java file in the navigation window and choose:
"run as" --> "java application"

This is the same as the ALT+SHIFT+X, J keyboard shortcut.

If you want to test it on the command line, after ensuring that you have Java installed and configured correctly you can simply use the compiler from the command line.

First, on the command line, navigate to the directory where you have your .java file.
Then type "javac MyFile.java" without the quotes.
Then type "java MyFile" again without quotes.

The javac command compiles the .java file into a .class file, and the java command runs the .class file.
brad211987 is offline   Reply With Quote
Old 02-13-2008, 06:21 PM   PM User | #8
ley
New Coder

 
Join Date: Jun 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
ley is an unknown quantity at this point
Try TextPad.

Oh make sure you are saving your .java file exactly the same as your class name
ley is offline   Reply With Quote
Old 02-13-2008, 09:57 PM   PM User | #9
playwiz
New to the CF scene

 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
playwiz is an unknown quantity at this point
Starting out with Java, I didn't like Eclipse much. I prefered Jcreator Pro and later on moved on to NetBeans. I still use Jcreator Pro occasionally.

-my first post!
playwiz is offline   Reply With Quote
Old 02-14-2008, 03:54 PM   PM User | #10
sybil6
Regular Coder

 
Join Date: Jul 2006
Posts: 399
Thanks: 33
Thanked 7 Times in 7 Posts
sybil6 can only hope to improve
Quote:
Originally Posted by binaryWeapon View Post
I don't need a fancy-shmancy IDE
well if you dont want a "fancy-shmancy IDE" go for notepad, lol.
sybil6 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:11 PM.


Advertisement
Log in to turn off these ads.