Anypoint Studio Exit Code=13 - mule

I noticed that the jre folder inside the Program Files is empty may be because of the some software update.
so had to download the jre, unzip it and then place it inside the same path as mentioned in the AnypointStudio.ini
-startup plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-vm C:\Program Files\Java\jre1.8.0_121\bin\javaw.exe
-vmargs
-Xms512m
-Xmx1024m
-XX:MaxPermSize=512m
-Dosgi.instance.area.default=#user.home/AnypointStudio/workspace
-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2

This maybe a 64-bit vs 32-bit issue. Please verify that both JRE and AnypointStudio are belongs to same bit version.
Please check this thread for similar issue.

This post from the Mulesoft site resolve my issue with this error. If you have multiple Java executables in your Path and the executable you add for the JDK needed for Mulesoft Anypoint Studio is not the first Java executable in your path, you will get this Exit Code = 13 error. Moving the new executable to the beginning of my path fixed the issue and Anypoint now runs.
https://www.mulesoft.org/jira/browse/MULE-13717?attachmentViewMode=list

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.

Error:java: Cannot run program CreateProcess error=2, The system cannot find the file specified

Error:java: Cannot run program "C:/Program Files/Java/jdk1.7.0_45/bin/java" (in directory "C:\Users\navya.chamidisetty\.IntelliJIdea2017.3\system\compile-server"):
CreateProcess error=2,
The system cannot find the file specified
I have started using IntelliJ 17 recently. When I checkout all my code in a folder and C:\ and loaded in Intellij. Now when I try to build, I am getting the above mentioned error. Could someone please help me how to solve this.
My %JAVA_HOME% = C:\Program Files\Java\jdk1.8.0_151
Value of Path variable in Environment variables = C:\Program Files\Apache Software Foundation\apache-maven-3.0.3\bin;C:\newcorpweb\cxf\bin
Value of Path variable in System variable = C:\Program Files\Java\jdk1.8.0_151\
IDEA doesn't necessary use JAVA_HOME variable. The project SDK (JDK in your case) is setup in the project settings: File -> Project Structure, Project SDK and set up the proper path there.
I have the same issue on NixOS with IntelliJ 2020.2. If I choose evident File -> Project structure -> SDKs -> + -> Download JDK, Idea does not see this downloaded JDK (error=2 etc.). But if I install and choose a system openjdk (located at /nix-store/...-openjdk-.../), everything works.
Using Open JDK by Red Hat solved my problem!
Link for the JDK
Open JDK by Red Hat

intellij - java: Cannot find JDK '1.7' for module

I've just installed IntelliJ on Windows 8 (and 7). I then use the 'Java Hello World' Sample as my project.
I then selected the JDK that was installed (C:\Program Files\Java\jdk1.7.0_10). Project creates successfully and I can see all the classes associated with the project etc. When I "make the project" I get the following error:
Compilation completed with 1 error and 0 warnings in 2 sec
1 error
0 warnings
java: Cannot find JDK '1.7' for module 'TEST'
No matter what I do I cannot compile any Java code under Windows8/IntelliJ
I have tried the following:
Invalidating cache.
Switching to 32bit JDK instead of 64bit
Idea64.exe instead of idea.exe
Installing 1.6 incase it was a 1.7 issue??
Changed the JAVA_HOME to point to different versions (ie currently C:\Program Files\Java\jdk1.7.0_10)
I'm lost as to why this is happening.
project structure > project > choose correct jdk
or ctrl+alt+shift+s > project> choose correct jdk
also platform settings > SDK's >and make sure 1.7 is there.
Found the root of the problem. Turns out Windows 8 under parallels shares the same Desktop as OSX. This confused IntelliJ somehow and as a result it couldn't compile properly.
In parallels by removing the "Desktop" shared under Configure this then resolves the issue.
In case you want to still share the documents & desktop, the solution is to modify the idea.properties file (for instance, under C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1\bin\idea.properties ), and change the following properties to point to different a location that is specific to the OS in which you are working:
idea.config.path=
idea.system.path=
idea.plugins.path=
idea.log.path=
I also copied the previous folder (on my computer it was under
\\psf\Home\.IntelliJIdea12
) to the new location to preserve all settings.
Update: I had the same problem after I installed IntelliJ Idea 13. I moved the .IntelliJIdea13 folder to c:\Users\costa from \\psf\Home, then I modified the C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.0\bin\idea.properties file:
idea.config.path=C:/Users/costa/.IntelliJIdea13/config
idea.system.path=C:/Users/costa/.IntelliJIdea13/system
idea.plugins.path=C:/Users/costa/.IntelliJIdea13/config/plugins
idea.log.path=C:/Users/costa/.IntelliJIdea13/system/log
I made the error while editing idea.properties to leave a whitespace at the end of my personally added idea.config.path=../.IdeaIC/config line.
This resulted exactly in the Cannot find JDK '...' for module error message.
I needed to "trim" the line manually, just deleted the whitespace, restarted IntelliJ and everything worked fine again.
I found this while scanning the idea.log file where I found java.io.FileNotFoundException: C:\Software\IntelliJ IDEA Community Edition 14.1.3\.IdeaIC\config \tasks\root.contexts.zip
In my case, Idea said "Failed to save settings" (probably due to a lot of projects being open. After that, it could not run tests with "Cannot find JDK '1.8' for module XXX" message. Idea restart solved the issue for me.
I believe this is an IntelliJ bug.
This isn't a fix, but you can work around this by going to Settings > Compiler, and disabling 'Use External Build'.
It seems that sometimes Intellij (or the user:-)) is getting confused when importing settings, especially if you change the paths where the jdk resides (for me it happened during a migration to a new Linux environment).
The only way I could correct this was to delete the user's settings folder.
In Linux :
I removed the folder (and subfolders): ~/.IntelliJIdea12/
Of course this would remove the saved settings, licenses e.t.c.

jmockit: Native library for Attach API not available in this JRE error

I was trying to use jmockit to unit test my project and got the following error:
java.lang.UnsatisfiedLinkError: no attach in java.library.path
java.lang.IllegalStateException: Native library for Attach API not available in this JRE
at mockit.internal.startup.JDK6AgentLoader.getVirtualMachineImplementationFromEmbeddedOnes(JDK6AgentLoader.java:95)
at mockit.internal.startup.JDK6AgentLoader.loadAgent(JDK6AgentLoader.java:54)
at mockit.internal.startup.AgentInitialization.initializeAccordingToJDKVersion(AgentInitialization.java:21)
at mockit.internal.startup.Startup.initializeIfNeeded(Startup.java:98)
at mockit.internal.startup.Startup.initializeIfPossible(Startup.java:112)
at org.junit.runner.Runner.<clinit>(Runner.java:22)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.UnsatisfiedLinkError: no attach in java.library.path
I have included jdk6/lib/tools.jar, jmockit.jar, and junit.jar in the classpath, respectively. Any clues why this is happening?
Go to Java Build Path of your project and change the JRE System Library and make it points to the jdk instead of jre.
It's not tools.jar that you need, but the native library file for the "Attach API": attach.dll (or the Linux/Mac equivalent, attach.so or similar). A plain JRE does not contain this library. Instead, point Eclipse to a JDK installation, which should contain the jre/bin/attach.dll file.
Add the path to attach.dll to your PATH environment variable
You have to set agent.
You can set VM arguments if you are using eclipse and Args will be like this:
-javaagent:local path to your jmockit jar\jmockit.jar
eg: -javaagent:D:\jmockit.jar
Dao Lam,
Here are some other things to try:
Make sure your project is using either:
The workspace default (That assumes that the default is your the jdk installation you just added. From the window where you added it, make sure it is checked.),
The jdk version, or
An execution Environment that uses the jdk version.
Pull up your system's environment variables, and add this path to it: (jdk_dir)/jre/bin. (Remember, you'll have to restart Eclipse once you've saved that to get it to take).
Close eclipse, and modify the shortcut you are using to start it to use (jdk_dir)/jre/bin.
I've found that any one of these measures will allow Eclipse to find the attach.dll.
Looks like you need to point your Eclipse to JDK , not JRE.
Steps :Windows->Preferences>Java>"Installed JRE's" and remove JRE from "Installed JRE's" window and add JDK browsing to your JDK location and select as default.
I found this issue with JDK 1.8.45 and 1.8.80 on 64-bit Windows. My solution was to copy attach.dll from the JDK's ./jre/bin directory to the ./bin. This eliminated the need for updating Eclipse and a Cygwin command line with a non-standard JAVA_HOME.
Maybe the Windows version may be ignoring the contents of the JRE directory?

Error occurred during initialization of VM

I'm getting the following error when running an executable I created on a 64-bit machine using C++ code:
"Error occurred during initialization of VM
Unable to load native library: Can't find dependent libraries"
My PATH (shown below) obviously points to jvm.dll since I have that file in both C:\Progra~1\Java\jdk1.6.0_17\jre\bin and C:\Windows\System32
PATH=C:\Program Files (x86)\Gmake\bin;C:\Program Files (x86)\apache-ant-1.7.1\bin;C:\Progra~1\Java\jdk1.6.0_17\bin;C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools;C:\Progra~1\Java\jdk1.6.0_17\jre\bin\server;C:\Progra~1\Java\jdk1.6.0_17\jre\bin;C:\Windows\System32
Does anybody have any ideas as to what would cause this error? Thanks.
Use dependency walker to figure out what dll is missing.
I have the same issue when I run the java.exe in my Windows2008 R2 version.
my path was
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;C:\Program Files\System Center Operations Manager 2007\
;C:\Java\jdk1.6.0_33\bin
when I run the java.exe under C:\Java\jdk1.6.0_33\bin, it works fine. I found that within the c:\Windows\System32\ comes with a copy of java.exe. When I run the c:\Windows\System32\java.exe, it shows the same error:
C:\>Windows\System32\java.exe
Error occurred during initialization of VM
Unable to load native library: Can't find dependent libraries
I fixed this issue by moving the C:\Java\jdk1.6.0_33\bin to the beginning of the PATH environment:
PATH=C:\Java\jdk1.6.0_33\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\
Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\System Center
Operations Manager 2007\
Hope this help.
This is how I solved a similar problem:
Used JavaRa: http://singularlabs.com/software/javara/ to remove old java versions.
Restarted the PC.
Re-installed the latest JDK version.
In my case, there was a jvm.dll file in the same folder as my exe file. I simply deleted the jvm.dll from there and it worked. Probably, it preceded the one in the PATH
I got this error as my PATH (environment variable) has not set correctly.
while setting PATH variable, set path of jvm.dll as a very first path in the list
Reboot your machine.
Note: Do not move jvm.dll to your project directory.
I had a complicated case. There was a jvm.dll file in the same folder as my exe file. I deleted it (because it shouldn't be there) but jvm.dll couldn't be find then.
I wanted to solve it by adding %JAVA_HOME%\jre\bin\server to my PATH because jvm.dll is located there. However, it didn't work. It turned out that the Windows loader won't expand the JAVA_HOME variable during searching for jvm.dll in the paths specified in PATH because I defined JAVA_HOME as user's variable. When I defined JAVA_HOME as a system variable, it started working as expected.