I want to run JMeter test plans from a UNIX server where env variables for java is not set. Its a test server and I dont have access to set that. We have different JDK versions and all are sitting in directories. I need to run my JMeter TestPlans on this server. I went to JDK /bin folder and tired to execute the below command
$ {jmeter-path}/bin/jmeter -nt testplan.jmx -l testresult.jtl
but this says
./bin/java: not found
But if I do simple java -version it shows the version result.Is that something that JMeter needs specifically the java env variable set or it wont run ? I dont have permission to set and I want to run the testplan using the JDK/JRE from its directories. A help would be appreciated. Thanks in advance!
UPDATE:
I think I could work around this by editing the jmeter script file as suggested in the one of the comments. Since my requirement was running the JMeter from a specific server, I could achieve this by editing the JAVA_HOME variable value in the script.
JMeter looks for java executable in system PATH so you have 2 options:
Add bin folder of your JDK or JRE to PATH, something like:
PATH=$PATH:/location/of/your/jbk/bin && export PATH && {jmeter-path}/bin/jmeter -nt testplan.jmx -l testresult.jtl
Or if you have java in PATH just run ApacheJMeter.jar like:
java -jar {jmeter-path}/bin/ApacheJMeter.jar
You might also want to use jmeter.sh wrapper script instead of jmeter, it has some logic regarding java binary location
More information: Get Started With JMeter: Installation & Tests
The official JMeter Getting Started documentation says this:
To install a release build, simply unzip the zip/tar file into the directory where you want JMeter to be installed. Provided that you have a JRE/JDK correctly installed and the JAVA_HOME environment variable set, there is nothing more for you to do.
Based on the symptoms that you reported, I think that you have not set JAVA_HOME correctly. It should be set to an absolute path to your Java installation's top directory.
Related
I installed Emscripten through the steps shown below:
1.) Download the emsdk-portable version for Linux/MacOSX
http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#sdk-downloads
2.)
Run
$ ./emsdk update
$ ./emsdk install latest
$ ./emsdk activate latest
$ source emsdk_env.sh (To update your environment variables)
I believe everything installed correctly, however I am unable to run emscripten anywhere outside of the emsdk folder.
I need to be able to run em++ in my: Documents/project3/dataviz/graphiti folder.
Also, when I run em++ -v in my emsdk folder, I get the following message I have been unable to resolve:
Java does not seem to exist, requierd for closure compiler,
which is optional (define JAVA in /home/bryce/.emscripten if you want it)
I attempted to define the java path in the folder, but I'm not sure how it should look.
Any help resolving these two issues would be very much appreciated.
The first problem sounds like the PATH isn't being set correctly. Type echo $PATH after running source emdsk_env.sh and check that the path to your emscripten installation has been added.
Note that you have to export the PATH for each terminal session you're using (it might be an idea to put source <path to emsdk dir>/emsdk_env.sh in your .bashrc file so this gets done automatically).
Could this link help with the second problem?
https://kripken.github.io/emscripten-site/docs/building_from_source/verify_emscripten_environment.html#installing-missing-components
I am starting to learn cassandra and downloaded the file from the Apache Cassandra. When I navigated through the bin folder of the apache-cassandra-2.2.1/bin and run the command cassandra it gives me the error saying Unable to find java executable. Check JAVA_HOME and PATH environment variables.
But at the same path when I hit java I am able to see the java is accessible there. What should I do to get rid of this? I am using Windows OS.
Edit:
I rather used Datastax windows installer and now I see no error in running cqlsh.
I was also facing the same problem. Actually, somewhere in installation scripts it adds "bin/java" to "$JAVA_HOME". In my case, java path was "/usr/bin/java" so I had to configure $JAVA_HOME=/user.
export JAVA_HOME=/usr/
Set JAVA_HOME:
Right click My Computer and select Properties.
On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.6.0_02.
FROM:
http://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html
login with root because Cassandra will start with the root
readlink -f $(which java)
vi ~/.bashrc
source ~/.bashrc
please note: java version should be same on cluster nodes
BR// nitin.k
On OS X 10.8.2, I'm using JNA and gstreamer-java (through the Eclipse IDE) to load gstreamer libraries. At first I installed gstreamer using the SDK provided by gstreamer.com. However, I uninstalled this and use Macports to install it.
The SDK's libs were installed to:
/System/Library/Frameworks/GStreamer.framework/Versions/0.10-x64/lib
But that directory no longer exists.
Where Macports installed the libs to:
/opt/local/lib
Now, say I want to set java to know of this location via some environment variable. Is this possible? It seems so, because running this line:
System.out.println( System.getProperty("jna.library.path"));
Shows /System/Library/Frameworks/GStreamer.framework/Versions/0.10-x64/lib. But I cannot for the life of me figure out where that got set. It's not set as a runtime VM argument. My $PATH and $DYLD_LIBRARY_PATH, $LD_LIBRARY_PATH do not have this directory set. They actually have the path I want, /opt/local/lib/ set which has no effect it seems. Running env shows no variables with the Framework path either.
So, jna.library.path. Is it set externally? How can I change it--without setting it at runtime or via java command-line arguments? Zero points for telling me to symlink.
EDIT:
Searching through gstreamer-java's files led me to gstreamer-java.spec, which has this line:
sed -i [...] -e "s,\(run.jvmargs=-Djna.library.path=\).*,\1%{_libdir}:$(pkg-config --variable=pluginsdir gstreamer-0.10),"
Running the contained command pkg-config --variable=pluginsdir gstreamer-0.10 gets me this:
/opt/local/lib/gstreamer-0.10
Which is the correct path for plugins. Further running pkg-config --print-variables gstreamer-0.10 gives me all these:
typelibdir
datarootdir
exec_prefix
pluginsdir
datadir
prefix
libdir
includedir
girdir
toolsdir
Which are all at or under the correct /opt/local/ directory.
Have you tried running outside of Eclipse?
I did have JDK installed, and also put $JDK_HOME/bin on my PATH. However, I still have problem to install Java EE. Could you guys give me some hints? Thanks.
dav#Bruno:~$ ls
[some stuff...]
33511405_3645.jpg glassfish stuff
bea hplip-3.11.12-plugin.run temp
bin hpscan001.png Templates
C03_08.txt java_ee_sdk-6u4-jdk7-linux.sh Tomcat
c4c jdk1.7.0_10 Ubuntu One
[some stuff2...]
dav#Bruno:~$ echo $PATH
/home/dav/jdk1.7.0_10/lib:/usr/share/java:/home/dav/jdk1.7.0_10:/home/dav/jdk1.7.0_10/bin:/home/dav/Fluent.Inc/bin:/home/dav/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/dav/jdk1.7.0_10/lib:/usr/share/java
dav#Bruno:~$ sudo sh java_ee_sdk-6u4-jdk7-linux.sh
Could not locate a suitable jar utility.
Please ensure that you have Java 6 or newer installed on your system
and accessible in your PATH or by setting JAVA_HOME
dav#Bruno:~$
I think the problem you're facing is that the PATH variable you're looking at is set for the user 'dav', but because you're sudoing the sh command, the PATH changes to that of root, which probably doesn't contain the JDK.
I think you should try explicitly setting the JAVA_HOME environment variable, try running:
sudo JAVA_HOME=/home/dav/jdk1.7.0_10 sh java_ee_sdk-6u4-jdk7-linux.sh
in case someone still gets frustrated over this:
("Could not locate a suitable jar utility.
Please ensure that you have Java 7 or newer installed on your system
and accessible in your PATH or by setting JAVA_HOME")
First of all make sure you are not using "sudo" to install java ee.
when you use sudo you use a different environment (root, with not necessarily the same
environment variables). in this case (ee installation) sudo is not required.
In other (which ever) cases when root access is required make sure the required user/system variables are set on system level, not (just) on user level.
to set variables at system level instead of user level define the variables in a system level script, i.e. /etc/profile or /etc/profile.d
otherwise, if you are not using SUDO trying to install jee, and still have this "JAVA_HOME not set"-problem, try this:
the cause seems to be the JAVA_HOME variable that can not be found by the install script.
therefore adjust ~/.bashrc to define JAVA_HOME.
JAVA_HOME of course has to point to your oracle java (se/jdk) installation. If you haven't installed it, that's the first thing to do. JAVA_HOME should point at the root directory of the installation (not to the bin directory in it), i.e.:
export JAVA_HOME=/usr/local/jdk1.7.1_02.
Next change path like so:
PATH=$JAVA_HOME:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
keep the faith
don't let frustrations get the better of you (perhaps making you take it out on your colleagues or loved ones :o )
don't allow stress to build up too much. take a break in time to watch a funny video or
take a stroll to the coffee machine, or have a little chat with that cute person a couple of desks away from you.
You'll need to create an update alternative for the "jar" executable like:
sudo update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0/bin/jar" 1
Note: You may need to use appropriate path in your case.
why the error occurs when i am starting the jboss server 6.0 ?
'findstr' is not recognized as an internal or external command,
operable program or batch file.
It looks like your PATH environment variable hasn't been set up correctly. Does this link help?
http://community.jboss.org/wiki/FindstrCommandNotFound
EDIT: are you sure that the JBoss startup batch script (usually in %JBOSS_HOME%\bin\run.bat) is picking up the PATH correctly? It might be running as a different user with a different PATH. Edit this script and add the line echo %PATH% before the first line that contains findstr. What output does this give you?
The only other place findstr is used (in jboss-6.0.0.20100721-M4 anyway) is in the service.bat script in the same folder as run.bat . Again, you could try putting echo %PATH% before the line in this script that uses findstr if the previous step didn't help you.
EDIT 2: according to your comments, the echo %PATH% line I asked you to add gave the following output:
E:\jdk1.6\bin;E:\apache-ant-1.7.0\bin;E:\jboss-6.0\bin\run.bat
Clearly this doesn't contain C:\WINDOWS\system32, so JBoss definitely won't be able to find findstr. But I don't understand why the PATH is ending up like this. How are you starting JBoss - as a service or by running run.bat? Is JBoss being run under some user account which has been set up with a very restricted PATH? Do you have some other script which is manipulating the PATH before JBoss starts? Also, which version of Windows are you using?
Also, it's not immediately clear to me from your three comments
I'm already checked that the findstr application is already in that path C:\WINDOWS\system32\
E:\jboss-6.0\bin\run.bat
Am also set that in the system variables in Environmental Variables
whether C:\WINDOWS\system32 is in the PATH in Control Panel > System > Environment Variables. Is C:\WINDOWS\system32 in the PATH in the System Variables section within the Environment Variables dialog?
This doesn't seem to be an issue with JBoss. This seems to be more of an issue with the environment within which you are running it. I can quite imagine a lot of other programs would be unhappy with being run in a similar environment.