![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems . |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sun Java Platform, Standard Edition 1.5.0_15 (Java 5 branch) | iBot | Software Releases - RSS News | 0 | 03-06-2008 05:50 PM |
| Simple Shell Script Question.... [java related] | Drags111 | Shell Programming and Scripting | 3 | 12-22-2007 05:23 AM |
| Java compiling error | Katkota | UNIX for Dummies Questions & Answers | 4 | 12-05-2007 09:35 PM |
| Newbie Question: passing a variable into java from script? | Cailet | Shell Programming and Scripting | 1 | 10-18-2007 10:31 PM |
| Question about compiling (noob) | arya6000 | High Level Programming | 9 | 12-11-2006 01:28 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
question about JAVA compiling ..
Hi ,
I don't know if this is the right place to post my question because it relates to JAVA . I am beginner of JAVA , using a tutorial as reference I am trying to run a simple program in JAVA env. I have installed JDSK kit from java.sun.com but when I tried to run a program from the DOS prompt , I am getting this error , This what I typed in : C:/Documents and Setting\javac -classpath ExampleProgram.java Error I got : 'javac' is not recognized as an internal or external command. I tried to set the environment variable also, but it is not working. Please help. Thanks. |
|
|||||
|
If c:\Program Files\j2sdk1.5 is where you have installed java sdk.
You can run javac from this directory as well. But getting a command prompt to traverse to this directory requires you to type in extra. So put c:\Program Files\j2sdk1.5\bin in your path. After that you can run javac, java from anywhere. It is best that you set classpath to include the current directory. Just append a . to the CLASSPATH settings if not already set. javac ExampleProgram.java Look at this instruction manual vino |
|
||||
|
Hi Vino,
Thanks for your time. But still I am getting error saying "cannot read:ExampleProgram.java" These are all the steps I tried . 1. I made C:/Program Files\Java\jdk1.5.0_04\bin (this were I have installed jdk) as my current working directory. 2 . then I setted up my CLASSPATH --> C:/Program Files\Java\jdk1.5.0_04\bin > SET CLASSPATH=%CLASSPATH%;. 3. then I complied my program from the above location : C:/Program Files\Java\jdk1.5.0_04\bin >javac ExampleProgram.java At this stage I am getting this error . error : "cannot read:ExampleProgram.java" 1 error Here is what the code I wrote : class ExampleProgram { public static void main(String[] args){ System.out.println("I'm a Simple Program"); } } Could you tell me what I am missing here? I appreciate your patience and time vino. Thanks. |
|
|||||
|
I will start again.
You should add the following to your path variables. C:/Program Files/Java/jdk1.5.0_04/bin You will need the classpath setting SET CLASSPATH=%CLASSPATH%;. Suppose, all your java programs are placed in c:/ANAMIKA56 You will need to traverse to c:/ANAMIKA56 and then issue javac ExampleProgram.java Once the program is compiled, run it as follows: java ExampleProgram The path settings is necessary because after that, you go to any directory you want and then issue a javac/java. If you dont set the path variable, you need to do the following everytime. C:/Program Files/Java/jdk1.5.0_04/bin/javac ExampleProgram.java. Like cbkihong said, its good not to put any java programs inside the java installation directory. vino |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|