MonkeyTalkIDE not found Java (JRE) / (JDK) virtual machine - android-monkey

I am trying to install MonkeyTalkIDE but show this error
A java Runtime Environment (JRE) or Java Development kit (JDK) must be available in order to run MonkeyTalkIDE. No Java virtual machine was found after searching the following locations: C:\Program Files\MonkeyTalkIDE\jre\bin\javaw.exe javaw.exe in your current PATH.
I am also set environment variable for java.
How can resolved problem?

Download a Java JDK here.
You might need to set JAVA_HOME to point to the directory where you install Java. (I'll assume you know how to do that.)
set JAVA_HOME=<directory-where-you-installed-JDK>
Add the path to the Java /bin directory to your PATH environment variable. (I'll assume you know how to do that.) If you do the second step, it'll be
PATH=%PATH%;%JAVA_HOME%\bin;

Related

Missing tools.jar when launching STS application

I have the latest STS4. I am using installed java-1.8 JDK not embedded as the execution environment. My project just runs fine without any issue.
However when I launch the STS application itself I have a pop up saying
"Missing tools.jar"
I have already tried:
pointing JAVA_HOME to different JDK
added -vm args in the .ini file.
Yet I cannot get rid of this pop up.
I solved this same problem by modifying the file "eclipse.ini". First I tried to solve it by modifying the file SpringToolSuite4.ini, but nothing happened, because I previusly had installed the eclipse ide, and the change in SpringToolSuite4.ini didn't work. then I modified the file eclipse.ini; and it worked.
The changes that I did in eclipse.ini are detailed below:
To check with what Java version (JRE or JDK) Eclipse is running, do the following:
Open the menu item Help > About Eclipse. (On the Mac, it’s in the Eclipse-menu, not the Help-menu)
Click on Installation Details.
Switch to the tab Configuration
Search for a line that starts with -vm. The line following it shows which Java binary is used.
Depending on the name and location of the used Java binary one can figure out if a JRE or a JDK is used:
If the path contains “jre” (e.g. as in C:\Program Files\Java\jre6\bin\client\jvm.dll) it is a JRE
If the path contains “jdk” (e.g. as in C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe) it is a JDK.
If no JDK is used for Eclipse, change it:
Quit Eclipse if it is running
Go to the Eclipse installation directory and open the file eclipse.ini in a text editor.
Search for the line -vmargs
Before the line -vmargs, add two lines:
On the first line, write -vm
On the second line, write the path to your JDK installation (usually something like: C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe on Windows)*
source: https://matsim.org/docs/devguide/eclipse/jdk
The fix is in the -vm parameter. the order and the absolute path of the javaw.exe seems to be the issue.
the readme file mentions _
"To run Eclipse with an alternate Java runtime environment, the path to the Java virtual machine's binary must be identified. With an Eclipse installation from the distribution, altering the $PATH variable to include the path to the alternate Java runtime environment is often not enough as the Eclipse that Linux distributions package often performs a scan internally to pick up GCJ by itself whilst ignoring what's on the $PATH."
So I have edited now the SpringToolSuite4.ini and made this entry
-vm
C:\UserTemp\Softwares\java\jdk\oracle-jdk-1.8-64bit\bin\javaw.exe
Restarted my STS and it works perfect.
The reference to set the JVM Specifying the JVM was very useful in understanding this.
Don't spend too much time looking for tools.jar. If you get an error like that, don't be upset.
If you already have java JDK1.8, go to its lib folder, tools.jar should be available there. Copy and paste the same in JRE1.8 lib folder.
I have STS4 so I have modified SpringToolSuite4.ini
I changed from:
[...]
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
[...]
to exactly this
[...]
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jdk1.8.0_152\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
[...]
And the message dissapeared
SOLUTION :
Check your Path JAVA_HOME - system property "Environment Variables"
for example: JAVA_HOME:
C:\Program Files\Java\jdk-12.0.1\lib
usually you only need add \lib at JAVA_HOME
Just remove this line from variable "Path"
"C:\Program Files (x86)\Common Files\Oracle\Java\javapath"
System Properties > Advanced > Environment Variables > Path > Edit > Reboot
Worked for me
In my case I had installed jre, and not jdk!
Observe that you have jdk installed!
I had the same issue when i upgraded to Java 11.
I simply edited SpringToolSuite4.ini and added
-vm
C:\Program Files\Java\jdk-11.0.4\bin\javaw.exe
For me, I had to do two things to make it work:
Remove vmargs:
vmargs
Dosgi.requiredJavaVersion=1.8
Setting the JDK:
vm
C:\Program Files\Java\jdk1.8.0_131\bin
By downloading the tool file and paste it in the jre\lib path. but make sure you should rename the pasted file as "tools.jar".
step 1
download the tool file.
download link http://www.java2s.com/Code/Jar/t/Downloadtools160jar.htm
step 2
extract the zip file.
step 3
you should rename the included .jar file as "tools".
step 4
then copy the renamed tools.jar file and paste in the C:\Program Files\Java\jre8\lib\ path.
then restart the STS ide.
I have fixed this from Window->preferences->Java->Installed JREs .
Then add the jdk bin path, uncheck other related jre paths
Copy JDK directory to your STS installation or extraction library and and rename JDK to jre. the directory structure of STS should look like this
.eclipseproduct
artifacts.xml
configuration
dropins
eclipsec.exe
features
jre
license.txt
META-INF
open-source-licenses.txt
p2
plugins
readme
SpringToolSuite4.exe
SpringToolSuite4.ini
Once STS open, initially its looking for tools.jar in jre\lib folder its not available in jre\lib folder.
so we need copy the tools.jar from jdk\lib folder and paste in jre\lib folder.
restart the STS, issue will resolve.

How do I make a program think it was built under a different directory with cmake while cross-compiling?

I am trying to cross-compile a web server (Monkey-Server). My host environment is an Ubuntu 64 bit and the target environment is an has an arm architecture. All the dependencies are available in the folder.There is an option to make install too, but I thought building it locally on my host machine transferring the folder over to the embedded system was a smart move. I am able to compile successfully and run the web server on the target system, but it complains that it is not able to find the config file. The web server looks for the config file in the path where it was compiled on the host machine.
Example: It tries to open a folder that only exist on the host machine
ERROR: Cannot find/open /home/username/src/camera_root/monkey-server/conf/
But it should actually be looking for the config file in
/monkey-server/conf/
This is what my toolchain file looks like
Set(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER /home/username/src/compilerdir/arm-hisiv300-linux-uclibcgnueabi-gcc)
#SET(CMAKE_SYSROOT /home/username/src/camera_root)
#SET(CMAKE_FIND_ROOT_PATH /home/username/src/camera_root)
As you can see at the bottom of my toolchain file I have tried to set both sysroot and find_root_path without luck.
When I tried the SET(CMAKE_SYSROOT /home/username/src/camera_root) line I was unable to compile because the C compiler was unable to compile a simple test program.
How do I help the web server find it's own config file?
This is an old question and the OP has probably moved on by now, but for anyone else with the same problem, the Monkey has a --configdir and a --configserver switch to set the location of the configuration files as a workaround for this problem.

Cannot get dependency to run in Intellij: UnsatisfiedLinkError

I have a Play framework application in Intellij to which I am trying to add Gurobi (an ILP optimizer) and have been running into some problems. I have followed all of the instructions for installing Gurobi from their website.
In Intellij, I have added Gurobi to a /lib folder in the project, and it resolves all the symbols in the code OK, the code compiles, and I can run the application. I added Gurobi to the java library path by adding this to the JVM arguments to the run configuration:
-Djava.library.path=/opt/gurobi605/linux64/lib
I have also added 4 environment variables to the run configuration:
GUROBI_HOME="/opt/gurobi605/linux64"
PATH="${PATH}:${GUROBI_HOME}/bin"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
GUROBI_LICENCE="/home/mcmellawat/gurobi.lic"
I have also added these environment variables to the .bashrc file per Gurobi instructions, though I'm not sure it matters.
Despite all this, I am getting the following error when trying to instantiate the first Gurobi object (GRBEnv to be specific) in my code:
java.lang.UnsatisfiedLinkError: /opt/gurobi605/linux64/lib/libGurobiJni60.so: libgurobi60.so: cannot open shared object file: No such file or directory
I have verified that this file does indeed exist in /opt/gurobi605/linux64/lib (it is actually a link to another file). What could be causing it to not be found?
The Gurobi FAQ (41) contains instructions how to use the Java interface from a development environment (e.g. Eclipse):
http://www.gurobi.com/support/faqs
1) You need to include gurobi.jar in your project (e.g. in your Build Path)
2) Make sure that the environment variable PATH (Windows) or LD_LIBRARY_PATH (Linux) contains the correct library folder.
On Windows this is by default the bin folder of the Gurobi installation (e.g. gurobi60.dll and gurobi65.dll)
On Linux this is by default the lib folder of the Gurobi installation (e.g. libgurobi60.so and libGurobiJni60.so)

On UnsatisfiedLinkError, clarification needed

When building the project from command line using mvn clean install everything builds without any issues.
When running some tests that use precompiled C libraries from IntelliJ, tests fail with java.lang.UnsatisfiedLinkError
I may be completely off here, but does IntelliJ not see the .so file? Is so, how can it be added please?
Shared library fails to load with UnsatisfiedLinkError if:
it's not in the working directory configured in the test run configuration.
it's not in PATH environment (on Mac Terminal and GUI apps have different environment, see this answer). Run IDEA from the Terminal open -a /Applications/IntelliJ\ IDEA\ 12.app/ to make environment the same.
it's not in the location specified using -Djava.library.path VM option.
.so depends on some other library that is not found for any of the 1-3 reasons (or the dependency of that dependency is not found, etc).

Maven not recognizing javac in my Ubuntu installation

I have gotten this error:
Compilation failure
Unable to locate the Javac Compiler in:
/usr/lib/jvm/java-7-openjdk-amd64/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
Now I have set some info in my .bashrc file like so: export PATH=$PATH:/usr/lib/jvm/java-6-openjdk/bin. I also did it in my /etc/profile file. But it still fails. But I am noticing that the above error is still going into jre instead of jvm. I don't really understand why its doing that. When I do which javac, it directs me to /usr/bin/javac. What exactly is that file? It seems Ubuntu defaults to JRE rather than the SDK. Either way I am confused as to how to fix this. Any help would be appreciated!