aspose file tools*
The moose likes Beginning Java and the fly likes starting java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "starting java program" Watch "starting java program" New topic
Author

starting java program

shri balaji
Greenhorn

Joined: Jan 04, 2007
Posts: 10
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?
Neerav Narielwala
Ranch Hand

Joined: Dec 08, 2006
Posts: 106
I think you must refer :
http://www.cafeaulait.org/books/jdr/chapters/02.html


<a href="http://www.java-tips.org/java-tutorials/tutorials/" target="_blank" rel="nofollow">Java Tutorials</a> | <a href="http://www.planet-java.org" target="_blank" rel="nofollow">Java Weblog</a> | <a href="http://computer-engineering.science-tips.org" target="_blank" rel="nofollow">Computing Articles</a>
Steffen Reinhard
Greenhorn

Joined: Jun 13, 2005
Posts: 19
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

Joined: Jan 04, 2007
Posts: 10
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
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

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.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
shri balaji
Greenhorn

Joined: Jan 04, 2007
Posts: 10
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.....
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
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?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
shri balaji
Greenhorn

Joined: Jan 04, 2007
Posts: 10
my problem is my windows xp not detecting java compiler...i did all the things that all are mentioned above
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
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

Joined: Jan 04, 2007
Posts: 10
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

Joined: Jul 22, 2000
Posts: 9043
    
  10
Where is javac.exe on your computer? Please tell me the directory.
shri balaji
Greenhorn

Joined: Jan 04, 2007
Posts: 10
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?
Nathan Leniz
Ranch Hand

Joined: Nov 26, 2006
Posts: 132
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 ]

The very existence of flamethrowers proves that at some time, some where, some place, someone once said to themselves "I'd really like to set those people on fire over there, but I just can't get close enough".
shri balaji
Greenhorn

Joined: Jan 04, 2007
Posts: 10
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
Lucky Chawla
Greenhorn

Joined: Aug 08, 2006
Posts: 22
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
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

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 ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
shri balaji
Greenhorn

Joined: Jan 04, 2007
Posts: 10
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

Joined: Jan 04, 2007
Posts: 10
thank you friends may i know where to compile java programs? START RUN
CMD OR COMMAND OR COMMAND PROMPT?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
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 ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
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

Joined: Jan 04, 2007
Posts: 10
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!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: starting java program
 
Similar Threads
developing GNOME applications
ClassPath
jvm version used by ant
problems with javac
Installin Java on Linux