Sponsored Content
Top Forums Programming How do i get Java commands to be recognized in command prompt? Post 302512678 by pflynn on Monday 11th of April 2011 09:07:55 AM
Old 04-11-2011
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:

PATH=$PATH:/home/anna/java/bin

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).
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

?Using Unix commands in Microsoft (Windows') DOS Prompt?

I ran a search for "Unix Dos" in the search field box and checked a few pages' results but did not find what I was looking for. I am trying to find out if there are choices of applications that would enable using Unix commands inside a Windows environment, particularly the DOS Prompt. The only... (2 Replies)
Discussion started by: HLee1981
2 Replies

2. UNIX for Dummies Questions & Answers

jar command not being recognized

Hi, I'm trying to extract a war file via the jar command; however, when I issue: jar -xvf MyWarFile.war I'm recieving "jar: not found" I added /usr/bin to the path ...didn't work also tried /usr/bin/jar to the path...still doesn't work My JAVA_HOME/bin is also in the path. ... (1 Reply)
Discussion started by: orahi001
1 Replies

3. Shell Programming and Scripting

Shell script to call multiple java commands

Hi, I want to call multiple java commands through a .sh file. I have drafted one with my least knowledge. But its not working. Pls help. I am trying to run this from Sun Solaris (OS 5.10) server with 10g oracle database. echo \* starting script AUTORUN echo \* get the Monitor path... (4 Replies)
Discussion started by: vivekdn
4 Replies

4. UNIX for Advanced & Expert Users

How to execute multiple unix commands in one session from java

Hi, Iam trying to code in java and wanted to run the commands in the Unix remote servers. I have the following code to run multiple GREP commands in a single session. But when i execute this, the first command executes successfully, whereas from the next line it says "Exception Occured... (1 Reply)
Discussion started by: gravi2020
1 Replies

5. Shell Programming and Scripting

How to enter commands to the command prompt in a program

Hey, So I'm trying to write a program in unix to automate a process for my astrophysics research. Basically I want the program to prompt the user for some information and store the entered string of text as a variable. I know how to do this. This is where I need help: Now lets say I have a... (4 Replies)
Discussion started by: freemoniez
4 Replies

6. Programming

Run Unix commands from Java

Greeings all Im trying to excute a command from Java and direct the output to the main output screen or to another file .... can you please help with this ? can I use filewriter for this ? Here is my code.... import java.io.BufferedReader; import java.io.File; import java.io.FileWriter;... (3 Replies)
Discussion started by: yahyaaa
3 Replies

7. AIX

"/" doesn't work on command prompt for searching commands last typed

When I use "/" to look for a particular command that I typed in the current session it says D02:-/home/user1/temp> /job ksh: /job: not found. D02:-/home/user1/temp> previously it used to fetch all the commands which had job in it.. for example subjob, endjob, joblist etc... may I... (7 Replies)
Discussion started by: meetzap
7 Replies

8. Programming

How to provide password to the prompt through Java

Hi All, I am using Ubuntu machine with JDK 6. I am running following command on shell- sudo ./somecript . Now, it prompts for sudo password and I provide the sudo password on shell and "somescript" starts running with sudo permissions. What I want to do is, I need to execute... (1 Reply)
Discussion started by: jaibhim
1 Replies

9. Programming

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? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

10. Shell Programming and Scripting

[Solved] Help with Overriding a Prompt in UNIX/Java

I am executing a shell script which contains a jar call to an external java package for which I don’t have a read access to. The external package was written in such a way that whenever we make a java –jar call to the package, it shows a prompt on the console asking if we want to continue or no... (1 Reply)
Discussion started by: Harry1302
1 Replies
AIRPORT2-CONFIG(1)					      General Commands Manual						AIRPORT2-CONFIG(1)

NAME
airport2-config - Configurator for the Apple AirPort Extreme Base Station ("Snow") SYNOPSIS
airport2-config DESCRIPTION
airport2-config allows you to manage your AirPort base station, just like the AirPort software on Mac OS X. OPTIONS
airport2-config accepts no command-line options. airport2-config is a wrapper script around the Airport2BaseStationConfigurator.jar jar file located in /usr/share/java/airport-utils. You can set the JAVACMD environment variable to use a specific JVM instead of the one chosen by the wrapper script. Set the DEBUG environ- ment variable to 1 to get the debug output from the wrapper script. ENVIRONMENT VARIABLES
DEBUG Set this variable to 1 to get the debug output from the wrapper script. JAVACMD The full path to the Java Virtual Machine to use. By default, the wrapper uses JAVACMD; if it is not set, it looks for JAVA_BINDIR/java, then for JAVA_HOME/bin/java before looking for a java executable in the PATH. In the latter case, the JVM used can be configured using the Debian alternatives system (see update-alternatives(8)). JAVA_HOME The full path where your JDK/JRE is installed. JAVA_BINDIR The full path to the directory where the java executable is located. JAVA_ARGS Extra command-line arguments to be passed to the Java Virtual Machine. AUTHOR
airport2-config was written by Jon Sevy <jsevy@cs.drexel.edu>. This manual page was written by Julien BLACHE <jblache@debian.org>, for the Debian project (but may be used by others). May 20, 2006 AIRPORT2-CONFIG(1)
All times are GMT -4. The time now is 09:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy