How do i get Java commands to be recognized in command prompt? | Unix Linux Forums | Programming

  Go Back    

Programming Post questions about C, C++, Java, SQL, and other programming languages here.

How do i get Java commands to be recognized in command prompt?


Closed Thread    
Thread Tools Search this Thread Display Modes
Old 04-11-2011
Anna Hussie Anna Hussie is offline
Join Date: Apr 2011
Last Activity: 10 August 2011, 11:29 PM EDT
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
How do i get Java commands to be recognized in command prompt?

I would like to do some of my Java programming homework at home, and when i type things such as "javac" & "java" it does not recognize it. How do i set it up so it recognizes Java coding?
Sponsored Links
Old 04-11-2011
pflynn pflynn is offline
Registered User
Join Date: Jul 2005
Last Activity: 21 August 2012, 9:51 PM EDT
Posts: 65
Thanks: 1
Thanked 14 Times in 12 Posts
You should set your environment so that the command interpreter (the shell) will be able to find the appropriate commands. This is something platform dependent, but most of the time what you need to do is to add the path of the java binaries to the PATH environment variable. For example, if your java binaries (java, javac) where installed in /home/anna/java/bin, you add the path to the PATH environment variable like this:


you can type this command directly into the command line, but this way it will be valid only for the current shell, so you´d better put this command into one of your shell´s initialization files (like $HOME/.bashrc or $HOME/.bash_profile if your shell is GNU Bash, for example).
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to provide password to the prompt through Java jaibhim Programming 1 11-15-2010 11:57 AM
"/" doesn't work on command prompt for searching commands last typed meetzap AIX 7 08-17-2010 04:17 AM
How to enter commands to the command prompt in a program freemoniez Shell Programming and Scripting 4 06-03-2010 05:31 PM
jar command not being recognized orahi001 UNIX for Dummies Questions & Answers 1 05-06-2008 11:29 AM
?Using Unix commands in Microsoft (Windows') DOS Prompt? HLee1981 UNIX for Dummies Questions & Answers 2 12-01-2005 05:30 PM

All times are GMT -4. The time now is 11:54 AM.