Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setting up java  RSS feed

 
Fabian Mladitsch
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have a problem setting up java jdk.
i've read that the best thing for beginners is to start programming java with a standart texteditor. so i downloaded the jdk, the problem i have, is that i can only compile, when i put my *.java files in the bin dir of the java dir.
how can i set it up, that i can just type javac *.java in the cmd line to complile sth without copying the java file in the bin dir?
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must add the path to your bin directory to the list of paths declared in the PATH environment variable of you operating system so that the the commands in the bin directory are available to you anywhere in the command line.

If you are under Windows, right click on My Computer->Advanced->Environment Variables...

In user variables declared a varibale named PATH in this way

PATH=%PATH%;<here place the path to you JDK bin directory>

(i.e. PATH=%PATH%;c:\jdk\bin)

After this you can use you java and javac commands from anywhere in the command line.

If you are under Linux you have different options depending on the distribution of Linux. Typically you can declare the PATH variable in the ~/.bashrc file, or the /etc/profile file or the /etc/environment file.

Another option is to make a link to the JDK in your /usr/bin directory using the command ln.

Take into account that paths in Windows are separated by a semicolon, while in Linux they are separted by a colon.

I hope this helps
[ December 11, 2006: Message edited by: Edwin Dalorzo ]
 
Neerav Narielwala
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tis url gives the details of java setup in a pc:
http://www.apl.jhu.edu/~hall/java/beginner/settingup.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!