Java Programing

mikeman06

Artifact Armor
Adventurer
Joined
Dec 14, 2004
Messages
797
Location
TX
Linkshell
RoyalKnights
anyone here know Java? Claxton and I have a class in school on it but our teacher knows shit about it. I've got some easy questions if anyone could help me out.
 
The closest she's come to helping is handing us a java book...
 
Java is my main programming language atm. While I don't have a lot of time to spare for lengthy questions, I can certainly help with little programs. Best way to learn from my experience is to mimic code you see in the book and from your past programs. After a while you will have a nice library to draw on for all your needs. Makes it much easier than working from scratch.
 
mikeman06 said:
anyone here know Java? Claxton and I have a class in school on it but our teacher knows shit about it. I've got some easy questions if anyone could help me out.

Sounds like alot of teachers I know in school. :x
 
Claxton said:
The closest she's come to helping is handing us a java book...

keh, reminds me of learning C++ .net ><

Edit: wish I could be of some help with the java stuff, but I never picked it up ^^;
 
all i need to know atm is how to run the program i made "Example.java" from the comand prompt. the book says to compile the file by going to the command prompt, i suppose, and typing "C:\>javac Example.java". That should then make a .class file. Then i'm supposed to be able to type "C:\>java Example" and it should run the program.

However, this does not work. It says, when i type "C:\>javac Example.java", "'javac' is not a recognized as an internal or external command, operable program or batch file."

Since i can't turn the .java file into a .class file i can't run "java Example"

I know that "javac" is the java compiler so that means i'm having trouble compiling the file right?

this is the Example file i was talking about:
/*
This is a simple Java program.

Call this file Example.java.
*/
class Example {
// A Java program begins with a call to main().
public static void main(String args[]) {
System.out.println("Java drives the web.");
}
}
 
Your code and commands are fine. Be sure to change directories until you get to where you java program is stored. Sounds though like your problem is you don't have all the java code apps installed on your comp. I had that problem a while back, but solved it by going to http://java.sun.com/ and downloading the latest version (on the right side).
 
ok i'm gonna try downloading the JDK 5.0

all i have is the j2sdk 1.4.2
 
Just add a path reference to be able to run javac from the command prompt.

Go to the Environment variables section and set or add a variable called path that references the location of your javac. (Assuming you're on Windows.)

Let me know if that doesn't make sense.

Either that or go download a freebie IDE like Netbeans or Eclispse.
 
More than likely you should stay far far away from JDK5.0...
Schools don't teach the newest stuff... Or at least most don't.
 
I was never really a big fan of java despite people telling me it would replace C and C++ and all this..

However.. a good reference/learning/question side for any programming language is located here
 
*Tag* I Start a Java programming class online on Sept 6th....so thanks for the advice in advance ^^
 
ok i figured it out. i was just typing ">javac Example.java"

when i should have been typing where javac was located like this ">jdk1.5.0_04\bin\javac Example.java" i did that and it made the class file then i typed "java Example" and it worked!!

Finally :!:
 
Back
Top