Could not reserve enough space for object heap with 0.13.1 on Windows? - scala

I installed sbt 0.13.1 from http://www.scala-sbt.org through the msi package.
When I try to start it through a command prompt i get this error
C:\Users\megatron>sbt
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
So I followed the recommendation in the setup notes
and added/changed this in the C:\Program Files (x86)\sbt\conf\sbtconfig.txt file.
-Xmx1536M
-XX:MaxPermSize=256m
-XX:ReservedCodeCacheSize=128m
-Xss1M
-XX:+CMSClassUnloadingEnabled
This doesn't help either and I still get the same error.

It seems you should not have white space characters in the installation path to sbt. You have one in Program Files. Try installing into a different location.

[EDITED, see below]
workaround for me: first try rebooting Windows
I've seen this problem in the past on Windows. Now again with sbt-0.13.5 on Windows 8.1.
By default the sbt installer installs to C:/Program Files (x86)/sbt. I also tried C:/sbt and got the same error while my system appeared to have almost 2G RAM still available. Next, without changing anything else I rebooted and sbt worked from C:/sbt. Then I re-installed using the default C:/Program Files (x86)/sbt path and still sbt works. Of course rebooting isn't a solution.
See related answer. The problem may be that when you are running sbt you are picking up 32-bit JRE (probably via C:/Windows/System32) instead of 64-bit in your path (check with java -version). Apparently the problem is then that although there may be enough memory overall it might not be contiguous that the JVM is requesting.

Related

javaw.exe and eclipse startup problems

I am trying to use eclipse juno and keep getting errors even after reading many pages here.
I get the following error when I try to start eclipse with the command line using C:\Users...\eclipse\eclipse.exe -vm "%JAVA_HOME%\bin\javaw.exe" -data C:...\workspace
"A Java Runtime Environment (JRE) or Java development Kit (JDK) must be available in order to run eclipse. No Java virtual machine was found after searching the following locations:
%JAVA_HOME%\bin\javaw.exe"
I get the following error when I try to start eclipse with the eclipse icon.
"A Java Runtime Environment (JRE) or Java development Kit (JDK) must be available in order to run eclipse. No Java virtual machine was found after searching the following locations:
C:...\jre\bin\javaw.exe
javaw.exe in your current path"
I have tried setting the path, but it doesn't seem to help. Will somone help me by explaining where to put the jre folder and whether to set the path or pathclass or how to set java home... I'm confused. Thank you!
Please try this command in windows command line and check if it outputs the correct path.
echo %JAVA_HOME%
It should point to something like - C:\Program Files\Java\jdk_version
If it is not, then you should follow these steps properly.
Also check if your PATH is properly set.
echo %PATH%
It should include %JAVA_HOME%\jre\bin If it is not, then you should follow these steps properly.
Once all the above steps are properly done, the Eclipse should start by directly clicking the icon.
I too received the same error white starting STS. the solution is simple:
First of all check if you have jdk installed or not. (I guess you do). If not then install it right now and copy the javaw.exe file from program files in your C:\Users...\eclipse\eclipse.exe -vm "%JAVA_HOME%\bin\ location.
Go to your variable path and check if your jdk is listed there or not. If not include it. C:\Program Files\Java\jdk1.8.0_121\bin
Retry. It will hopefully run. And if you are still getting the error, then most probably it's because you are using a wrong jdk (32 bit or 64 bit). Reinstall the correct one.
This will surely eliminate the error.
Enjoy

Eclipse does not find Valgrind

I installed Valgrind on SUSE Linux SLES 11SP2 under my home directory and added it to the path. I then installed eclipse Juno for C/C++ Service Release 2 Build id: 20130225-0426 and installed the Valgrind plugin.
When I try to create a profile configuration with Valgrind I get an error message:
"[Valgrind Options]: Couldn't determine version of Valgrind", and though it allows me to make the configuration it prevents me from proceeding by greying out all buttons except for the close button.
I know I am missing something trivial like defining the location of the Valgrind executable in eclipse, but I was unable to find it, not in the project properties nor in the window preferences.
I will appreciate your help.
Ok, I figured it out.
I moved the Valgrind installation to a new shared location, and tried it out with a new computer (same architecture).
It did not affect the original computer I installed it on, but Valgrind had a problem with the new one, as indicated in the README (and I meanwhile forgot):
“Important! Do not move the valgrind installation into a place different from that specified by --prefix at build time. This will cause things to break in subtle ways, mostly when Valgrind handles fork/exec calls.”.
This caused Valgrind to break when run standalone with the message:
“valgrind: failed to start tool 'memcheck' for platform 'amd64-linux': No such file or directory”,
however when running Valgrind from eclipse it probably translated it to the message:
"[Valgrind Options]: Couldn't determine version of Valgrind".
In short: Do not move the Valgrind installation but re-install it. And this message from eclipse indicates that something bad happened with the installed Valgrind and not that it cannot find it.
I am getting the same error but its not caused by the explanation you have given.
You can get this error if you are using valgrind on mac os x because valgrind is usually not installed in the directory eclipse is looking for. In order to fix the issue on mac, you need to make a symbolic link to the valgrind location by
typing ln -s valgrind_location /usr/bin/valgrind. Note this differs from what are in the directions on eclipse's site http://wiki.eclipse.org/Linux_Tools_Project/Valgrind/User_Guide. For some reason they have the call backwards on their site. Once I made this correction valgrind worked correctly from within Eclipse.
So on macs at least the error that it can't determine the version of valgrind at least matches up with eclipse not being able to find the file.

DartEditor.exe and java exit code 1

I try to run DartEditor on Windows. I've downloaded the latest version from:
dartlang.org/docs/getting-started/editor/index-win.html
(i tried both the stable and untested latest version - same results)
At first Editor was facing problem with finding the java virtual machine, so I added the path to the "DartEditor.ini", which now looks like that:
-data
workspace
-vm
C:\Program Files\Java\jdk1.7.0_02\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx1024m
Now java is starting BUT it's returning following error:
(sorry for URLs, but i'm not yet allowed to post images)
and information:
I suppose that this error is connected with eclipse, but sadly I have no idea where exactly the problem is. Any help appreciated.
I don't see anything wrong with your posted .ini contents, it could be that you are seeing https://bugs.eclipse.org/bugs/show_bug.cgi?id=188968
Essentially the -Xmx1024m might be too large and the jvm can't find a contiguous block of memory that large. Shared libraries might be loaded in the middle of the address space fragmentin the available memory).
By removing the .ini file, you get the default Xmx args which are much lower. You could try changing to -Xmx512m or -Xmx768m.
I had the same issue until I upgraded my JRE from version 6 to 7. Though dartlang.org states that Dart Editor's minimum required Java version is 6, I believe they may have forgotten to update this info.
Additionally, dartlang.org states that Windows XP is not supported. FYI

Eclipse executable launcher error: Unable to locate companion shared library

I had Eclipse Indigo installed on my computer with the Android plugin and it was working perfectly for about two weeks. Today, I updated java and quicktime then restarted my computer. When it booted back up, eclipse had completely vanished - all the program files have completely disappeared. When I try to reinstall it, I get an error message that says
The Eclipse executable launcher was unable to locate its companion shared library.
What happened and how can I fix it?
I've just encountered the same issue. The problem for me was Windows 7 default unzipper program. It has a problem when it encounters files that have a deep file structure. I read about this issue some time ago but can't recall the article. Fix for me is to unzip the Eclipse download using WinZip (or some other tool which does'nt have this issue).
Check eclipse.ini, there are two entries like:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
For some twisted reason jars have version in their name - so if you upgrade/have two different version of eclipse( while eclipse.ini is either linked or provided as system wide conf file for eclipse ) it will cause above error.
That sounds pretty bad and weird. But reinstalling isn't that hard - download, unzip, change the default memory allocation, run Eclipse, install necessary plugins and features.
And almost all of the important preferences are in your workspace. The only important one I can think of outside of the workspace is the aforementioned memory allocation, which you can set on the command line or in the ECLIPSE.INI file.
During unzip in a cygwin directory on Win7, .exe and .dll need to be given executable mode. This is the solution from a mintty (or other $TERM) terminal run with cygwin on windows 7:
me#mymachine ~/eclipse
$ find . -name "*.dll" -exec chmod +x {} \;
tried with Juno (eclipse 4.2) freshly unzipped, cygwin 1.7.something
I have seen this in MacOS Sierra. Sometimes unzipping the app leaves extended attributes that seem to prevent the startup. The following command line removes extended attributes and seems to fix the problem:
xattr -c Eclipse.app
It also works for other applications that are built on the eclipse framework.
Another problem (that I ran into) is that Cygwin's unzip utility (UnZip 6.00 of 20 April 2009, by Cygwin. Original by Info-ZIP.) does not always correctly unzip everything needed for Eclipse to actually run.
Using 7ZIP v9.20 got Eclipse Indigo (3.7.2) up and running for me on Win7 64bit with 32bit JVM and 32bit Eclipse.
(First time I've ever had Cygwin's unzip fail on me...)
I just ran into this myself and found that, indeed, as one post above stated: using cygwin and gunzip or unzip to set up your eclipse environment the permissions on the .exe and .dll files will be incorrect and the JVM will not run them properly.
Quick solution:
#switch to the eclipse target folder
cd /cygdrive/c/Program\ Files\ \(x86\) #or wherever you put eclipse
find ./ -regextype posix-extended -mindepth 1 -type f -regex ".*\.exe|.*\.dll" |\
xargs chmod -v 750
I meet this issue after copy a eclipse installation to another pc.I find the eclipse installation auto created the .p2 directory on my c:\Users\xx.p2, and --launcher.library refer to here.So it doesn't exist on my another pc.
My resolution is to reinstall eclipse:
a)Double click eclipse-inst-win64.exe
b)Click to change to advanced mode.
c)Uncheck the Bundle Pool
d)Finish your installation and copy again.Everything will work well.
My experience and advice: Install Eclipse Juno on C: drive.
After download the zip, put it on C:, click the right mouse button -> extract here. Then a folder called eclipse will be created in C: drive.
Then go to Eclipse executable, run it, and all will be ok.
I faced this problem and solved it by running Eclipse as admin.
Problem happened when I unzipped using Cygwin. Used the Windows XP standard unzip program and it worked.
if you are having two eclipse then sometime this happens
you only have to remove
-startup
plugins\org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar
from eclipse.ini file beside eclipse.exe(Launcher)
Also see this related question's answer.
The gist is: Try unzipping it again with a solid unzip tool. Sometimes unzipping goes wrong, especially with the built-in Windows Explorer tool.
i have this error message when i use extract the files as follows:
action\select all
drag and drow the files to an new folder
Somehow information about the folders get lost
when i use "action\extract to..." it works.
Also, remember to right click on eclipse, then choose Security Unblock
Mostly this is related to problems on windows with the unzipping it seems. (See other answers here for that).
The second largest issue seems to be that eclipse is not able to find java or finds a java version which is too old or even older eclipse installations.
Here's another take to the latter problem and a small twist to solve it. My work environment is on a linux system, without root access, and with software installations where I can configure which versions to use in a kind of config file. However I have no influence on the way those software packages are installed and they are immutable to me.
I download and untar the latest eclipse as usual to a user disk for which I have write permissions. Then I configure myself an alias to always temporarily cd into the eclipse installation when starting. That regardless of where I work on the file systems, eclipse always finds its correct libraries. It seems in some places, eclipses default search path for java digs out an installation (of java or older eclipses or sth else) in my environment that it really should not use.
Here's the alias:
alias eclipse '(pushd /enter_path_to_eclipse_install_dir_here/eclipse ; ./eclipse ; popd)'
Now you can start it normally from e.g. your project or arbitrary work directory:
eclipse
Or also put it in the background
eclipse &
Maybe this helps for people in convoluted work environments.
Try running eclipse.exe as administrator or using Eclipse Helios.
I have copied the Eclipse folder from another machine where the path was different and that was the root of this problem. Changing the plugins path in ECLIPSE.INI worked for me !!
Solution for Mac
Reason:
Eclipse copies from one location to other
Solution:
Paths change needed in /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini
Fix path for plugins\org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar
I had the same problem when I was trying to install it on Windows 8.
But it was an zip composed file....
Ones I unzip and Run "eclipes.exe" file as run As 'Administrator' it was resolved.
Now I am enjoying it very well.
I had the same message after a system restore with the eclipse folder (V. 3/2020) being located on a second drive (that was NOT restored at the same time, I use it for large files mainly).
Restoring the faulty installations C:\Users<user>.p2 folder to the new installation (referenced in eclipse.ini of the eclipse folder) worked.
Keep shorter folder name, fixed for me.
I faced this issue recently: (In my case it was installation of STM32CubeMX software):
what I faced: I have two users in my laptop, I had installed the software in one user but on the hard disk partition: D:\
Now I had tried to work on another user!
-- I think you know why I got the error --
So as I was working on the 'other' user account, I got this error every time I tried to compile/build my project - obviously, Because I installed using one user and am working on another.
Workaround: Already mentioned in the above answers clearly!
What I did differently: I tried using the S/W in the other user, but there seems to be issues on the path file/location:
so I reinstalled the location in the user account I want to use and am running it properly now!
Note: While Installing it did ask about installing the software for all user/ current user : I mistakenly had given 'current - user' =(
I also faced ths problem, I just deleted the extracted file and extracted it again.
I have a .rar file.
This problem occurs when the file is not extracted completely.
You might changed your drive-letter:
once u had installed eclipse on D:\, after windows reinstall the drive-letter is now E:\ (for example).
look into eclipse.ini in your eclipse folder, there are some lines where the drive-letter is still D:\
This happened to me when I tried to open eclipse.exe before the .zip file finished extracting. Make sure all dependencies are unzipped or unpacked before opening the .exe.
I had this issue on Linux (CentOS 7 64 bit) with 32-bit Eclipse Neon and 32-bit JRE 8. Non of the answers here or in similar questions were helpful, so I thought it can help someone.
Equinox launcher (eclipse executable) is reading the plugins/ directory and then searches for eclipse_xxxx.so/dll in org.eclipse.equinox.launcher.<os>_<version>/. Typically, the problem is in eclipse.ini pointing to the wrong version of Equinox launcher plugin. But, if the file system uses 64-bit inodes, such as XFS and one of the files gets inode number above 4294967296, then the launcher fails reading the plugins/ directory and this error message pops up. Use ls -li <eclipse>/plugins/ to check the inode numbers.
In my case, moving to another mount with 32-bit inodes resolved the problem.
See: http://www.tcm.phy.cam.ac.uk/sw/inodes64.html
I encountered this error with the Eclipse 4.10 installer. We had failed to complete the install correctly due to platform security settings and attempted to uninstall but had to do it by hand since no uninstaller was introduced during the failed install. We suspected this corrupted the end result - even after re-installing.
The solution was to use the JVM to launch Eclipse and bypass the launcher executable entirely. The following command successfully launches Eclipse 4.10 (some parameters will change based on the version of Eclipse):
%JDK190%\bin\javaw.exe -jar C:\<fully_qualified_path_to_eclipse>\Eclipse410\plugins\org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar -clean -showsplash
After using this command/shortcut to launch Eclipse we had no further errors with Eclipse itself but we weren't able to use the EXE launcher in the future. Even after a year of using this version, the launcher continues to display this same error.
To be clear, you'll have to modify your javaw.exe command to match your system specifications on MS Windows.
I got similar error sometime back. I had copied the eclipse setup from another laptop to mine. The issue with my setup was that path of the "--launcher.library" in the eclipse.ini file. The path in --launcher.library was that of the old machine and hence I was getting the error
I changed the path of "--launcher.library" in eclipse.ini to the path of eclipse on my laptop and the issue got resolved. I hope this is helpful to someone is getting this error.
remove it and run eclipse-installer again without root
I have create Demo.exe using Eclipse RCP.
I have run Demo.exe using C-Drive to same error generate like...
Solution : You might changed your drive for example
C:\Demo.exe to D:\Demo.exe
Step 1 : First Copy/Cut your .exe file like C:\Demo.exe
Step 2 : After Paste another drive like D:\Demo.exe
After executable file launching successfully.
I hope my answer is useful.

How to diagnose eclipse crashes?

OMG, eclipse (it's Gallileo, but with previous versions I also had such problems) crashed again, silently as always. That can happen one time per week, but this is really annoying. All I have now is a crash log. Are there any ways of discovering the true reason of these crashes?
Header of crash log, can't see anything useful:
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d80f8d4, pid=1388, tid=3180
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_12-b04 mixed mode)
# Problematic frame:
# V [jvm.dll+0xcf8d4]
#
I used to have these kind of silent crashes on 64-bit Linux. For me it was fine after adding these lines to my eclipse.ini (see corresponding Eclipse and Sun bug entries):
-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith
-XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,<init>
For Galileo, I would recommend trying to launch it with the most recent JVM possible;
That does not mean you have to compile your projects with that JDK: you can declare as many JDK you want within your eclipse session.
(source: benmccann.com)
(although this picture shows jdk1.5, you can launch eclipse with any other JVM)
See this eclipse.ini for more details.
As this recent thread illustrates, that can happens with an "old" eclipse.ini, so it is worth checking and updating the ini file.
This is a bug in the Sun's Java VM which Eclipse triggers. These are notoriously hard to figure out. I suggest this approach:
Install a newer VM (1.5.0 16 or 1.6)
Disable all plugins you've installed
I had a similar issue with Groovy on Linux. I don't remember my solution but try a different version of Groovy in this case.