Java Installation Troubles

I want to be able to compile and run some java files. I know I have to download to SDK from java.sun however I did and I'm still unable to compile any java files after I installed this;

Download J2SE Development Kit 5.0 Update 6 with NetBeans IDE 5.0 Bundle

from http://java.sun.com/j2se/1.5.0/download-netbeans-50.html

I'm I missing a software package or something.

Also I know at school where I usually compile all my code if I view the java file there's usually an icon, but my java files on my computer have no icon, meaning its not recognized as a java file right now. Sorry I'm new to java and have no idea whats up.
SchmidtZ28Asked:
Who is Participating?
 
SchmidtZ28Author Commented:
Also under my C:\Program Files\Java directory i have jdk1.5.0_06 and jre1.5.0_06, but on the installation guide from school they say I did j2sdk1.5.0_06 or similar folder do I need this software and how do I get it?
0
 
suprapto45Commented:
Hi,

It seems that your Java installation is successfully installed. May I know how do you compile your Java classes?

David
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
suprapto45Commented:
http://java.sun.com/j2se/1.4.2/install-windows.html

Look at point 5 - "Update the PATH variable" to make your javac.exe, java.exe available from any directory

David
0
 
cincin77Commented:
hi,

first open a command prompt and try:

java -v
javac

does your windows know the path for these commands or it says "No command found".

if you have javac, try:
javac Your_class_name.java

after that you should have a file Your_class_name.class.
assuming you did not use any package statement in your java file,
"java Your_class_name" will run your class' main method.

hope this helps..
0
 
SchmidtZ28Author Commented:
Ok I have a sample java file which I know works however I can't get it to run on my laptop;

public class DebugOne1
{
  /* This program prints a greeting*/
  public static void main(String[] args)
      {
      System.out.println("Hello");
  }
}

I run cmd

C:\> E:
E:\> cd 108 Lab\Week1
E:\108 Lab\Week1>path =C:\Program Files\Java\jdk1.5.0_06\bin
E:\108 Lab\Week1>javac DebugOne1.java
E:\108 Lab\Week1>java DebugOne1

Exception in thread "main" java.lang.NoClassDefFoundError: DebugOne1


0
 
suprapto45Commented:
Hi

It means that you have successfully installed Java. It has the problem on classpath only. Let me direct you to the right way.

David
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.