Link to home
Start Free TrialLog in
Avatar of c4mar
c4mar

asked on

java1.22 setup

Hi, I am interesting at java. However, I have problem to setup the problem since I am self study about java. Currently I had download the jdk1.22, kawa and Jdk 1.22 API into my computer.
After I read through the JDK1.22 API, I still no idea how to setup this thing to run my application. Therefor I jus wondering is there any Web address to guide me  through how to setup the run time enviement???? Cause I am thinking to make 2D and 3D window in my application, and I keep on getting "thread in main, java.lang.... not found" such message. Due to teh setup problem, my process is going nowhere. I really need a hand on this to get me to start up. Thanks
Avatar of jerch
jerch

set your classpath in the your autoexec.bat if you're using windows.

set classpath=.;

if you're using linux
(sh and bash shell),
CLASSPATH=.;
EXPORT CLASSPATH

(csh and tcsh shell)
setenv CLASSPATH=.;


Start here:
http://java.sun.com/docs/books/tutorial/
You can even download it and store it locally.

You do NOT need to set classpath at all in JDK1.2. It just adds confusion for new-comers.

Make a HelloWorld.java file containing:

//HelloWorld.java
public class HelloWorld {
   public static void main(String args[])  {
         System.out.println("Hello World");
   }
}
//end of file

Compile it by:
javac HelloWorld.java

Run it by:
java HelloWorld

Things to notice:
1) <installdir>\bin needs to be in your path (i think you have that already
2) Java is case sensitive!!!! Make sure you have upper and lower case letters correct
3) The public class name has to be EXACTLY the same as the file name
4) Use the .java extension when compiling but DO NOT use the .class extension when running. (Dont ask why.. i have no clue)

The above should get you so that you can compile and run your first simple program.
If this doesnt work copy/paste the exact error you receive.
Hold off on the Java3D API til you get confortable with 2D.
Java3D is an add-on.  It is not built in to the current JDK release.
jerch changed the proposed answer to a comment
Avatar of c4mar

ASKER

Thanks, I just wanting does the packetage setup in the same way too??? I mean when I create my own package class. Do I need to setup some path for it too??
ASKER CERTIFIED SOLUTION
Avatar of jerch
jerch

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Alternatively you can "install" your package.
make your package a jar file (or multiple packages in a jar file)
and place in your <installdir>\jre\lib\ext\ directory
JDK/JRE1.2+ will look to this directory before looking at the classpath env variable for all your compiling and running needs.
Then you can import like Jerson said above.