• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

starting java program

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any one can help me out about installing java compiler and including java bin and etc etc.... and where is the path i should include bin?
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you must refer :
http://www.cafeaulait.org/books/jdr/chapters/02.html
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shri balaji:
any one can help me out about installing java compiler and including java bin and etc etc.... and where is the path i should include bin?



Hi Shri,

first you need to go to
JDK 6.0 Download page
to get the current JDK (which is version 6.0 as of now). The smaller JRE download won't do as it is just the Java Runtime Environment. Download the Java installer for your operating system.

If you're using Windows, install Java, just like any other Program, just by double-clicking the .exe file you downloaded in the previous step.

This installs the complete JDK, including compiler, aplletviewer, runtime environment, the proper java packages, etc. You wont have to worry where to store any binaries, the installer takes care of the details.

You can check your installation by typing (in a Console Window):
which should return a message confirming you're using, say, Sun JDK 1.6.0 (or whatever you actually installed).

Futhermore you should consider setting PATH and CLASSPATH environment variables. PATH should include the bin directory of your JDK, whereas CLASSPATH should include the current directory (".").

On my Linux box, I edited the .bashrc file (which contains general settings) to include JAVA_HOME which points to my JDK directory, JRE_HOME which points to the jre subdirectory of my JDK directory, and JAVA_BINDIR to point to the bin subdirectory. I don't know if all af them are really necessary, but I had a bit of trouble with an pre-installed Java version and the aforesaid settings helped me switch my os to use JDK 1.6.

Hope this helps.

Cheers,


Steffen
 
shri balaji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you very much mr.nairelwala anh shreen for youe valuble information hopes it'll very usefull to me & once again thanks a lot.....
another thing may i know the difference between jdk and j2sdk
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shri balaji:
...another thing may i know the difference between jdk and j2sdk


From Sun's 1.5 docs, Version 1.5.0 or 5.0?...

Due to significant popularity within the Java developer community, the development kit has reverted back to the name "JDK" from "Java 2 SDK" (or "J2SDK"), and the runtime environment has reverted back to "JRE" from "J2RE"...



With respect to setting your PATH variable, be sure to follow Sun's Installation Instructions (for version 6.0).

I would recommend against setting a system CLASSPATH variable -- but if you must, then be sure it includes the current directory (.) as suggested above.
 
shri balaji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry brothers!! i've installed jdk1.6.0 but again the same problem persists after seting the path too... in system properties advanced tab i have changed user variables and environmental variables.but same prob again please any one help me out.....
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shri balaji:
i've installed jdk1.6.0 but again the same problem persists after seting the path too... in system properties advanced tab i have changed user variables and environmental variables.but same prob again please any one help me out.....



What problem is that?
 
shri balaji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my problem is my windows xp not detecting java compiler...i did all the things that all are mentioned above
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Find the directory where jdk is installed (probably something like C:\Program Files\Java\jdk1.6.x_xx). Go to the bin directory and see if there is javac.exe there.

If so, set environment variable JAVA_HOME to C:\Program Files\Java\jdk1.6.x_xx and add %JAVA_HOME%\bin to the environment variable PATH.

Then open a command prompt (DOS window) and type javac.

What do you see?
 
shri balaji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
again and agian i'm getting the same error message "javac is not regonised as a internal or external command" PLEASE URGENT ANY ONE HELP OUT FROM THIS HEAD ACHE
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is javac.exe on your computer? Please tell me the directory.
 
shri balaji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in c:\j2sdk1.4.0\bin\javac please reply and help me to set the path correctly.I gave path values for user variables and also system variables separetly but its not just working!!! what to do?
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is that the only thing in your path user variable? Also, did you set the classpath? If it isn't the only thing, then reply with a paste of the entire value exactly.
[ January 07, 2007: Message edited by: Nathan Leniz ]
 
shri balaji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the entire value of my path value is c:\j2sdk1.4.0\bin and i didnt set class path and all.... explain how to set class path.The compiler javac is detected when i typed set path=c:\j2sdk1.4.0\bin;$path; in command prompt for temperarly, but every time i want to type these things be4 compiling. so i want to set this permenently
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi balaji
Do onething first undo all the classpath.. beacuse I dont think that to tun a java or javac exe you need to set it.. simply install it .. and in prompt go to the java directory where javac and java is located and type javac or java -version and you should see the help options or the version respectively

I am sure this will work
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shri balaji:
in c:\j2sdk1.4.0\bin\javac please reply and help me to set the path correctly.I gave path values for user variables and also system variables separetly but its not just working!!! what to do?


Did you install JDK 1.4.0 or 1.6.0? Uninstall version 1.4.0 and download and install JDK 6, which is the most recent version.
[ January 08, 2007: Message edited by: Jesper Young ]
 
shri balaji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no lucky chawla i can run the java file but every time i'm forced to type the full path value.i want to make it permamently change the path value so that system will detect javac file.Yes i tried both all versions of java but still problem exits
 
shri balaji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you friends may i know where to compile java programs? START RUN
CMD OR COMMAND OR COMMAND PROMPT?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Start / Run / Cmd or Start / Programs / Accessories / Command Prompt. Those should get you the same place.

On one computer I have several versions of the JDK and I don't like having any path or classpath stuff for Java in the permanent settings. I do both of those in BAT files, which are easier to edit and change than Windows settings.

See if THIS helps.
[ January 08, 2007: Message edited by: Stan James ]
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shri balaji:
I gave path values for user variables and also system variables separetly



Normally you only change the PATH variable in the system variables (unless you can't access the system variables and then you change it in the USER variables.
 
shri balaji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DEAR FRIENDS,
i am very thankfull to all of them those who helped me here and sujested different answers.Finaly i found my mistake i've donwe a great mistake by running java in command prompt.... if we change path variables evrything will affect or changes will adopt in cmd not command both or different... if i run javac in cmd its working.so any way again i'm very happy
that i've lots and lots of friends here to help me thans a lot!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic