I cannot run my Ant build.xml since I updated to java 1.7.0_52 (or there about). I have been running it for years through Eclipse locally on my Windows 7 laptop - but with this latest jave jdk update somethings different (?).
BUILD FAILED
C:\workspace\WaterAspectsModel3\build.xml:329: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "D:\Morten\Java\jdk1.7.0_52"
This is my jdk! So JAVA_HOME is pointing to a jdk (as is also clear from the error message). I have my JAVA_HOME with bin folder in my path as always. I've configured Eclipse - external tools configuration - with a JRE pointing to the same D:\Morten\Java\jdk1.7.0_52 (through "Separate JRE" setting). And I've tried a number of other configurations - all without luck.
I've been reading the tonnes of answers on lists here and other places and think I've tried all suggestions. Most seem to be cases where JAVA_HOME actually points to a jre and just needs to be corrected to jdk or there's a ";" in the path or something like that. None of these seem to apply in my case.
Any suggestions?
I was having the same message when running ANT through Eclipse.
What worked for me:
In Eclipse, access the menu: "Window -> Preferences";
Access "Ant -> Runtime", at the tree;
Access the Classpath tab;
Expand the "Global Entries" item;
Inside Global Entries, the path to tools.jar was wrong. It was pointing to an older version of Java;
I removed the wrong entry and added the correct one with "Add External Jars" button. It worked.
The solution
"Had to copy C:\Program Files\Java\jdk1.6.0_10\lib\tools.jar to C:\Program Files\Java\jre6\lib\ext" from here was great helpful and worked for me.
The real message is that Ant can't find com.sun.tools.javac.Main.
Which, together with the fact that the latest "Sun" (Oracle) JDK is 1.7.0_13 (or maybe _14, but definitely not the "_52" that your install dir indicates), makes me think that you're not using a distribution that Ant recognizes. You can verify this by running jar tvf $JAVA_HOME/lib/tools.jar, and looking for that class.
The Ant Manual talks about ways to work with different compilers. Since I've only used "Sun" compilers, I'm afraid that I can't give you any pointers.
Edit: you could also try setting fork="yes" in your build file. This should run the compiler executable rather than trying to invoke the compiler class.
Try adding JAVA_HOME\bin to your env PATH .
Add JAVA_HOME to Eclipse-Preferences-Java-Build Path-Classpath Variables.
Sorry for the unearthing,
I had the same problem, my solution doesn't need any modification in environment variables, and works for a recent JDK where the tools.jar can't be found.
Just go in the small down-arrow next to the ant run button
Then click "Configure external tools"
Then in JRE tab
Select a JDK installed on your computer, not a JRE, no problems if the selected JDK is not the same JDK/JRE as in your project.
It should be work now.
When you start Eclipse for the first time, it asks you the path for the workspace. Now, normal path should be C:\Users\USERNAME\Workspace but, if I try to set %USERPROFILE%\Workspace it doesn't work, it creates a folder called %USERPROFILE%\Workspace under the Eclipse folder.
So the question is: how to use windows environment variables to specify workspace path? Thank you.
P.S: I know that Eclipse has got customizable environment variables but I didn't try them and I want to use them neither.
You can run eclipse.exe -data %USERPROFILES%\myCustomWorkspaceDir to have the workspace in your wanted sub directory. In this case, you will not even get the dialog asking for the workspace.
There are still more runtime options for Eclipse.
When ever I try to launch my eclipse I am getting the following exception an its not coming up.
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Need help.
Thanks.
The /configuration/config.ini file should contain org.eclipse.core.runtime#start in the commaseparated osgi.bundles property. Here is the default osgi.bundles property, maybe it was (accidently) changed during some upgrade:
osgi.bundles=org.eclipse.equinox.common#2:start,org.eclipse.update.configurator#3:start,org.eclipse.core.runtime#start
You can if necessary override it by setting it as VM argument in /eclipse.ini:
-Dosgi.bundles=org.eclipse.equinox.common#2:start,org.eclipse.update.configurator#3:start,org.eclipse.core.runtime#start
I have had the same problem, and here's how I solved it: I added the plugin "org.eclipse.core.runtime" in the "plugins" section on the "configuration" tab of the .product editor. I set it's start level to default and auto-start to true. I removed other plugins. My reasoning was this: Eclipse is complaining that the org.eclipse.core.runtime isn't started, so let's make sure that it does start, and that it's the only plugin that's starting.
My application ran fine after I did this. I then inspected the config.ini to see what changed, and saw that org.eclipse.core.runtime was now changed to org.eclipse.core.runtime#start. This is consistent with BalusC's suggestion, I just did it from the .product editor.
Adding my two cents for those searching for "Ensure that the org.eclipse.core.runtime bundle is resolved and started":
Adding "arbitrary" bundles to the list of bundles just because it seems that they are missing is not always the best solution. Sometimes it can get quite frustrating, because those new plugins might depend on other missing bundles, which need even more bundles and so on...
So, before adding a new dependency to the list of required bundles, make sure you understand why the bundle is needed (the debugger is your friend!).
This question here doesn't provide enough information to make this a valid answer in all cases, but if you encounter the message that the org.eclipse.core.runtime is missing, try setting the eclipse.application.launchDefault system property to false, especially if you try to run an application which is not an "eclipse application" (but maybe just a headless runtime on top of equinox).
This link might come in handy: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html, look for the eclipse.application.launchDefault system property.
try running it from the Command Line as:
>eclipse -clean
Or, you could run it using java instead of the default javaw, here:
>eclipse -vm c:\jdks\java_1.5\jre\bin\java.exe
I got this problem with Mac OS Lion, after transfer OS/Data from an older machine to a new one.
Solved deleting the old eclipse folder (which I have in Applications folder) and copy eclipse folder again (same version, same unpacked zip file, no changes).
The accepted answer above is correct, except for it's not completely clear.
You need to add the following line to the bottom of the eclipse.ini file:
-Dosgi.bundles=org.eclipse.equinox.common#2:start,org.eclipse.update.configurator#3:start,org.eclipse.core.runtime#
For me installing the jdk 1.8 solved the issue.
This error happen cause you deleted the config.ini file while you deleted the plugins. So, when it can not find configuration in config.ini when eclipse lauchingļ¼ then it use default configuration which is not fit with your os. The following steps solve you problem:
Delete setting in configuration folder.
create a new config.ini file.
copy following setting and save:
osgi.splashPath = platform:/base/plugins/org.eclipse.platform
osgi.bundles=org.eclipse.equinox.common#2:start, org.eclipse.update.configurator#3:start, org.eclipse.core.runtime#start
eclipse.product=org.eclipse.sdk.ide
osgi.instance.area.default=#user.home/workspace
eof=eof
restart eclipse.
For me, what eventually did the trick was adding -clean at the start of eclipse.ini
In the Windows environment, running Eclipse as Administrator solved the issue. (Right click>Run as Administrator)
if you face this in 2021 or later better check that you have jdk 11 installed and is configured correctly. I downloaded the latest eclipse-jee-2021-06-R-win32-x86_64 and on running i got this issue. I checked the java version on my system and it was: 1.8 I downloaded the latest OpenJDK 11 configured it (JAVA_HOME in an environment variable and <JAVAHOME/bin entry in PATH environment varaible>) and the issue is gone.
I've been downloaded the "SDK ADT Bundle for Windows" adt-bundle-windows-x86.zip to "Documents and settings\myusername\My Documents\Downloads" and tried to unzip to a folder c:\Android
When all seems to be decompressed I saw some files where missing in the destination folder including the eclipse.ini.
I solved this by renaming adt-bundle-windows-x86.zip to a short name adt.zip, moving it to c:\ and repeating the decompression.
All is due to bad treatment of long file-names in windows
For those coming here having tried to run the application from a Windows command line, or batch file, and possibly those receiving the stated error message in a Rational Clear Case log file:
The PATH is very important to the processing of config files, and the following was required for me:
START "Clear Case" /D"C:\Program Files (x86)\Rational\ClearQuest\rcp\" "C:\Program Files (x86)\Rational\ClearQuest\rcp\clearquest.exe"
note the /D option.
Adding to a well-populated page:
I had this come up when I tried to move the eclipse installation to a different location on my drive. I tried grepping for the old directory path in the package, thinking perhaps I could fix it with sed, but the path was written in multiple formats and even found in binary files. I gave up, made a fresh install, and re-installed my plugins.
(Here's a question about moving an eclipse installation, but it didn't give me enough to make it work.)
I tried all the methods proposed here. I finally deleted the eclipse folder, extracted it again and now everything works perfectly.
I received this message trying to run STS 3.7.0 on java 6 jdk, after pointing to java jdk 7 (-vm param in STS.ini) the issue disappeared.
I got this problem somewhere on the logs and I saw that my java version was not 1.8 somehow. Upgrading it again to 1.8 solved my problem.
Download new eclipse or spring suite and open old workspace into new eclipse or STS
shawn: My eclipse have started when I extended bundles:
osgi.bundles=org.eclipse.equinox.common#2:start, org.eclipse.update.configurator#3:start, org.eclipse.core.runtime#start, org.eclipse.equinox.ds#start, org.eclipse.equinox.event#start
If none of the above answers works for you, try the following:
Get the "org.eclipse.equinox.simpleconfigurator" and the "org.eclipse.update" folders found under the "eclipse\configuration" from a working Eclipse instance (can be the stock Eclipse downloaded from their website) and replace them in your Eclipse installation directory.
This fixed it for me.
I tried all the answers above, but none of them worked for me, so I was forced to try something else. I just removed the whole package with settings org.eclipse.Java and it worked fine, starts again like before and even keeps all settings like color themes and others. Worked like charm.
On Linux or Mac go to /home/{your_user_name}/.var/app and run the following command:
rm -r org.eclipse.Java
On Windows just find the same directory and move it to Trash.
After this is done, the settings and the errors are deleted, so Eclipse will start and re-create them with the proper settings.
When Eclipse starts it will ask for the workspace directory. When specified, everything works like before.
The only thing that worked for me was to run Eclipse using JAVA from the command line.
C:\Development_Tools\eclipse\java-2021-092\eclipse>java -jar plugins/org.eclipse.equinox.launcher_1.6.300.v20210813-1054.jar
This was executed from the folder where eclipse.exe resides.
I made my own shortcut for this and now use that shortcut instead of the one produced when installing Eclipse from their website.
in my opinion, if after trying all solution nothing wors then simply delete eclipse folder from your C://use/{pc}/eclipse and then again install the same eclipse . You will get all your data no need to worry.
This happens because of unexpected shutdown of your eclipse
delete processcenter.ini at location similar to:
C:\IBM\IntegrationDesigner\v8.5\iid
and then once IDE comes up, go to windows preference and put in the correct URL.
could not open C:\Program Files\Java\jre6\lib\i386\jvm.cfg
is the error coming when i am trying to start eclipse ide.
my C:\Program Files has
jdk1.6.0_14
jdk1.6.0_17
jre6
folders.
path is set to
PATH: C:\Program Files\Java\jdk1.6.0_17\bin
what is the problem
i have seen this link but it is not solving my problem
can't find JRE in the JDK
I had similar problem on a Windows machine. I had moved my Java directory from inside "Program Files" (the space in the directory name was giving me trouble) over to c:\
I set all my PATH variables to the new location, restarted the machine and thought that would be enough. Nope
java -- version
Error: could not open `C:\Program Files\Java\jre1.8.0_66\lib\i386\jvm.cfg
This solution came from the good folks over at coderanch
Start regedit (just type "regedit" into the Run program) and work your way down to HKEY_LOCAL_MACHINE > SOFTWARE > JavaSoft
There you will find several different java directories
Java Development Kit
Java Plug-in
Java Runtime Environment
Java Update
Java Web Start
In each directory you'll find different directories for the different version of java (esp. Java Web Start). Open each and every one and you'll see that your old path is still listed. Double click the Name (left column) of the listing and manually type in the new path.
Open a new terminal and type in Java - version and you should be fine.
This problem can show up if you initially install Java in the default location (C:\Program Files) and then later re-install into another location.
The default installation copies java.exe, javaw.exe and javaws.exe to C:\Windows\System32. If you are in this situation and delete these files it will likely solve your issue.
(Thanks to Jay: http://jaykhimani.blogspot.com/2012/09/error-could-not-open-cprogram.html)
Problem: Eclipse Neon error: "C:\Program Files\Java\jre1.8.0xx.xx\jvm.cfg"
Solution Win7 Pro: System Properties > Enviorment Variables > System Variables > Path > Edit > #make sure the current JAVA directory appears first in the path if more than 1 JAVA directory exist.
In the path that follows, I moved "C:\ProgramData\Oracle\Java\javapath" behind the current directory "C:\Program Files\Java\jdk\bin;C:\Program Files\Java\jre\bin" > save
Path
C:\Program Files\Java\jdk\bin;C:\Program Files\Java\jre\bin;C:\apache-maven-3.5.0\bin;C:\ProgramData\Oracle\Java\javapath
I also had this problem and was having trouble finding a solution, but now I did!
If you uninstall your current running jre version and then install higher one you are good to go.
I was using jre1.6 when I had this problem but after installing 1.7 it was solved!
I recently got the same problem on my Windows 7. The issue was that two different paths were specified for Java in the path environment variable. This can be checked as follows.
On the command prompt, run the following command:
> where java
C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe <br/>
C:\Program Files\Java\jdk1.8.0_192\bin\java.exe
The first one was the cause of the issue and removed it from the path.
Eclipse is working now without re-installation.
Note: The environment vars have been as follows always:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_192
JRE_HOME=C:\ProgramFiles\Java\jdk1.8.0_192\jre
The problem is that your eclipse cant find jre.Just copy and paste your jre folder into eclipse folder and then start eclipse.Delete environment variable.
What worked for me was to go back to the Java webpage and download the Java jre instead of the jdk, since that is what the stupid computer is now looking for. Then open the C: Program Files>Java and make sure you see jre7 instead of jdk.
RS
Have a simpler solution:
Check your PATH. Most likely it is referring to incorrect java.exe. This started happening to me when I installed OS patch. In process of checkpoint etc, PATH got modified. Once I corrected it (using Environment Variables...), it worked immediately.
Try putting below line in your eclipse/STS -STS.ini file
-vm
C:\Program Files\Java\jdk1.8.0_121(your JDK version)\bin\javaw.exe
Put it at the top of the file.
Most probably it will work.
Sometimes putting javaw.exe in eclipse folder also work (where eclipse.exe is there)
This is an old post, but what solved my solution was editing the `eclispe.ini' file to include the correct path to the JDK.
Building off of what Lars answered, I did reinstall Java, so that may have been the source of the issue. Reglardless, this is the solution that worked for me. I did not have to delete any files from C:\windows\system32, however. I merely told eclipse to look in the new Java installation directory.
These docs indicated I needed to specify the path to the VM:
-vm
C:\Java\jdk1.7.0_25\bin\javaw.exe
This problem mainly occurs when we install new jre or jre gets updated automatically since jdk version and jre version are different and path variable i.e. JAVA_HOME contains jdk path with version included in it . Eclipse might be using that to generate the jre path name for the said file.
I did workaround i.e. changed name of jre folder to the older version e.g.
jre1.8.0_191 is after installing update and
jre1.8.0_60 was before update.
I renamed jre1.8.0_191 with jre1.8.0_60 to solve the issue
I had faced similar problem. Environment variable path problem
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_192
Set the Environment variable after going
Control Panel\All Control Panel Items\System and select Advanced System Settings then set Environment Variables
In System Variables add a new variable JAVA_HOME and variable value = C:\Program Files\Java\jdk1.8.0_192, the path of the jdk file in your system.
and %JAVA_HOME%\bin in the path of the system variables.
Hopefully the problem will solve.
After doing this It works fine for me.
I recently uninstalled and then reinstalled Java on my machine and ever since, Eclipse just does not start up. I find this weird, because I uninstalled a different version of Java from the one that I use. I modified the eclipse.ini file, by adding the following:
-vm
C:\Program Files (x86)\Java\jre1.5.0_15\bin\javaw.exe
This made no difference. I then tried to reset the JAVA_HOME variable and I tried both these things again, after reinstalling (well, unzipping) Eclipse again. None of this made any difference, which is why I'm posting this question. Can someone help me out here?
You need to make sure that the path to javaw.exe is in %PATH% environment variable. Basically:
%PATH% = %PATH%;c:\path\to\jre\bin
You can configure this in the environment variables configuration and you can verify this by opening a command prompt and test if java is recognized as a command from inside an arbitrary path.
The %JAVA_HOME% should by the way point to the JDK's /bin folder, not the one of the JRE. Regardless, this environment variable is ignored by Eclipse since it comes with its own compiler.
I uninstalled all the versions of Java I had installed and installed them again. I also deleted Eclipse and downloaded that again. Following this, I edited the eclipse.ini file to include the path the javaw.exe, as I mentioned in the question. Everything works fine now.