• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting up Java following instructions from Head First Java  RSS feed

 
Abhishek Vijayan
Greenhorn
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Ubuntu.
After unpacking the tar file for JSE 1.7 version 45, in the the bin directory for adding an entry to PATH variable,
I typed

javac

and I get the message

The program 'javac' can be found in the following packages:
* default-jdk
* ecj
* gcj-4.6-jdk
* gcj-4.7-jdk
* openjdk-7-jdk
* openjdk-6-jdk
Try: sudo apt-get install <selected package>

Do I have to install these ?
Please help me out
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

How did you set the PATH? Did you open a new terminal window after setting the PATH? Which folder did you put the unzipped Java® installation in?
 
Abhishek Vijayan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
The unzipped Java is in /Java
I used cd command in the terminal and went to /Java/jdk1.7.0_45/bin
and then I typed javac and I got this message.
I didn't do anything else for setting the path
Now how should I proceed ?
 
Surendra Kumar
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want a command to execute from current folder, use ./ (e.g., ./javac).
If you don't want to do that, add the Java bin path to PATH variable.

$>set PATH=$PATH:/Java/jdk1.7.0_45/bin

After the above command now javac works without './'.
 
Abhishek Vijayan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Surendra Kumar... I made some mistake installing it..
Followed the instructions given in "How to create your first Java program".

 
saravanank kathirvelp
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes you have to give to install these and use javac

sudo apt-get install
 
saravanank kathirvelp
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Welcome to the Ranch

How did you set the PATH? Did you open a new terminal window after setting the PATH? Which folder did you put the unzipped Java® installation in?


how?
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I suspect the problem was solved two weeks ago.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!