|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
How to compile and run java in UNIX?
Hi Im using MobaXterm Unix on my windows XP.I want to compile java in unix.I have installed java to the following path C:\Program Files\Java\jdk1.7.0_09\bin In order to compile the java prog im typing the following command after entering into the bin directory: Code:
C:\Program Files\Java\jdk1.7.0_09\bin $ javac Example.java But im getting the following message: Code:
bash: javac: command not found plz Help. Thanks
Last edited by vbe; 12-06-2012 at 04:37 AM.. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
You have to add the absolute path of javac to PATH env variable. Code:
export PATH="$PATH:/your_javac_path_here/" Or try running like below once you are in bin directory:- Code:
./javac Example.java |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
run the javac command as below: Code:
JAVA_HOME=/your_javac_path_here $JAVA_HOME/bin/javac Example.java |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| java compile and run program help | cokedude | UNIX for Advanced & Expert Users | 1 | 10-09-2012 04:26 PM |
| Compile & Run Java Code | tguillea | UNIX for Dummies Questions & Answers | 4 | 05-28-2010 04:59 PM |
| trying to compile and run java through the terminal | killesk | UNIX for Dummies Questions & Answers | 2 | 05-06-2009 11:15 AM |
| how to compile and run java programs | mayahari | Solaris | 3 | 03-03-2009 03:25 AM |
| compile java with GUI on unix system/putty | finalight | Programming | 0 | 05-22-2008 04:41 AM |
|
|