Click to See Complete Forum and Search --> : Confirm JDK Install/Eclipse


JockVSJock
04-19-2003, 10:26 AM
I installed JDK on RH 8.0 box and did the install and when doing rpm -qa | grep jdk, it shows installed.

What is a simple java program that I can do to confirm the install.

Also I am interested in installing Eclipse, do all I need is JDK installed?

thanks

filp
04-19-2003, 10:42 AM
umm,,
if there's a program called java in your path then it's install.

Filp.

Parcival
04-19-2003, 10:44 AM
Well, the easiest program is always this one: :)

public class HelloWorld
{
public static final void main( String args[] )
{
System.out.println("Hello World");
}
}

If it compiles and runs correctly you know that your JDK has been successfully installed. :)

Yes, JDK is all you need as it has "all inclusive". :)

nickptar
04-19-2003, 10:51 AM
Put in Hello.java (MAKE SURE IT'S CAPITALIZED):

public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}

then run:
javac Hello.java (this should produce Hello.class)
java Hello (this should print Hello World!)

JockVSJock
04-19-2003, 10:52 AM
I type



javac test.java



and get the following output

-bash javac: command not found

I have installed jdk under /usr/local/jdk. There is no bin directory, but it is all of the users paths.

?

thanks

Parcival
04-19-2003, 02:08 PM
Well, obviously you installed everything correctly and also enter the right commands in the shell. However, there should be a folder in your jdk folder with all the programs like e.g. javac, java, etc.

Copy your Hello.java file into that subdirectory and try again. Your file should then compile and run correctly.

With Eclipse you can tell the program where it finds the necessary java programs to compile etc, so you can comfortably edit/hack your programs in your working folder while Eclipse uses the relational path to compile them. :)

JockVSJock
04-19-2003, 02:25 PM
Originally posted by Parcival
However, there should be a folder in your jdk folder with all the programs like e.g. javac, java, etc.


There are no directories for installing JDK, I think there is a problem...because I don't see a bin, which is where I have seen alot of directions want you to put into a path.

Parcival
04-21-2003, 04:16 PM
I don't know if I'm a big help, but in my case I installed the whole thing simply into

/usr/java/j2sdk1.4.1_02/bin

and it works just nice. :confused: