Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
| Search | Today's Posts | Mark Forums Read
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 24th, 2006, 09:30 PM
Authorized User
 
Join Date: Jul 2006
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ironchef
Default I am a beginner, and i need major help!!!

Ok, first off.... I'm not even sure if i have downloaded the right thing but this is the link of the version of SDK I have downloaded:

http://java.sun.com/j2ee/1.4/download.html

If that is not the right one will someone pls tell me?!

Here is the source code I made for simple writing:

public class OurFirstProgram {

    public static void main(String[] args){

        System.out.println("Krakatoa, EAST of Java??");
    }
}


If that is right, I think this next step is where i went wrong.
I saved it as OurFirstProgram.java. If that is right... then its definately the compiling. How do you compile a java program?

I'd appreciate your help!
:DIronChef:D
__________________
<b>IronChef</b> - http://www.freewebs.com/cool_recipes
  #2 (permalink)  
Old July 24th, 2006, 09:56 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First you must set the system environment,let the system know where the compiler is.
Then use the cmd.exe.

Just goto the directory where your OurFirstProgram.java saved.Then type "javac OurFirstProgram.java"in the cmd.
So it will create a file named OurFirstProgram.class in the same directory.
The type "java OurFirstProgram" in the console.

  #3 (permalink)  
Old July 24th, 2006, 10:08 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh right.
Now I use Jcreator Pro to compile and run my java program.
You can goto www.jcreator.com to download the latest version.
If you need you can email me.
and i'll give you the registration name and key for the Jcreator Pro.
My email address is kejinlu@gmail.com.
  #4 (permalink)  
Old July 24th, 2006, 11:51 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am a student from china.
And my english is very pool.
I am afraid that I can't explain it clearly to you.

In the Java world ,JVM( Java virtual Machine) is a very important component.
It allows your java codes "written once ,running everywhere!"
so **.class file just the file which the JVM can read.
And this kind of file must be created by javac.
Suppose OurFirstProgram.java is in the directory C:/

you can do like this:
C:/>set path="your bin directory"
C:/>javac OurFirstProgram.java
(after this step,you'll find that a file named OurFirstProgram.class is created)
C:/>java OurFirstProgram
(rember .class is not needed after OurFirstProgram)


  #5 (permalink)  
Old July 25th, 2006, 01:11 PM
Authorized User
 
Join Date: Jun 2006
Location: boston, MA, USA.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ya the above guy is correct . The name of the class file should be the same as the public class present in that file and for the same reason there cannot be more than one public classes in one file.

  #6 (permalink)  
Old July 27th, 2006, 01:29 PM
Registered User
 
Join Date: Jul 2006
Location: Coimbatore, Tamil Nadu, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to pulidot2000
Default

If you're using author Ivor Horton's beggining java book, then if you download the java jdk 5.0 version from java.com it would be appropriate for learning.

  #7 (permalink)  
Old July 28th, 2006, 03:45 AM
Registered User
 
Join Date: Feb 2006
Location: Xiamen, China, China.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by kejinlu
 I am a student from china.
And my english is very pool.
I am afraid that I can't explain it clearly to you.

In the Java world ,JVM( Java virtual Machine) is a very important component.
It allows your java codes "written once ,running everywhere!"
so **.class file just the file which the JVM can read.
And this kind of file must be created by javac.
Suppose OurFirstProgram.java is in the&nbsp;&nbsp;directory C:/

you can do like this:
C:/>set path="your bin directory"
C:/>javac OurFirstProgram.java
(after this step,you'll find that a file named OurFirstProgram.class is created)
C:/>java OurFirstProgram
(rember .class is not needed after OurFirstProgram)


In fact ,you explained very well¡¢very clearly!



Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't know where to start(Need Major help) Jett Access 3 June 27th, 2008 06:57 AM
DoCmd.Quit -Major screw up-Please help! stealthdevil Access VBA 1 September 5th, 2007 11:18 AM
Need Major Help!!!!!!!!!!!!!!!! Phrozen1der JSP Basics 0 May 10th, 2004 04:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.