Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Failed to create the Java Virtual Machine(Cannot run Eclipse (Helios) on Mac after Java update 1.6 Update 3 any more.)
Failed to create the Java Virtual Machine [message #635099] Mon, 25 October 2010 15:55 Go to next message
Stephan Bachofen is currently offline Stephan BachofenFriend
Messages: 3
Registered: October 2010
Junior Member
Hi there

After this weekends Java 1.6 Update 3 on my Mac running Snowleopard 10.6.4 the Eclipse won't run any more. I get an Alert box stating Failed to create the Java Virtual Machine.
When I run it from the prompt I get:
cd /Applications/Apps/eclipse-jee-helios-macosx-cocoa
./eclipse -vm
JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.

The eclipse.ini looks like this:
-startup
../../../plugins/org.eclipse.equinox.launcher_1.1.0.v2010050 7.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1 .1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

The file system where Java lives looks like this:
cd /System/Library/Frameworks/JavaVM.framework/Versions
ls -al
drwxr-xr-x 14 root wheel 476 25 Okt 14:35 .
drwxr-xr-x 12 root wheel 408 25 Okt 14:35 ..
lrwxr-xr-x 1 root wheel 5 25 Okt 14:35 1.3 -> 1.3.1
drwxr-xr-x 3 root wheel 102 21 Jul 2009 1.3.1
lrwxr-xr-x 1 root wheel 10 25 Okt 14:35 1.4 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 25 Okt 14:35 1.4.2 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 25 Okt 14:35 1.5 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 25 Okt 14:35 1.5.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 25 Okt 14:35 1.6 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 25 Okt 14:35 1.6.0 -> CurrentJDK
drwxr-xr-x 10 root wheel 340 25 Okt 14:35 A
lrwxr-xr-x 1 root wheel 1 25 Okt 14:35 Current -> A
lrwxr-xr-x 1 root wheel 59 25 Okt 14:35 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents
drwxr-xr-x 3 root wheel 102 22 Okt 12:41 disabled

The Java Preference Panel shows:
Java SE 6 64-bit 1.6.0_22-b04-307
Java SE 6 32-bit 1.6.0_22-b04-307

The Java versions hows:
java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)

The environment variables look like this:
env
LC_MONETARY=de_CH.utf-8
TERM_PROGRAM=iTerm.app
M2=/Applications/Apps/maven/bin
TERM=xterm
SHELL=/bin/bash
TMPDIR=/var/folders/BO/BOC+Ji7xG4GvCW+eVpjM5k+++TI/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-v3lgx7/Render
LC_NUMERIC=de_CH.utf-8
OLDPWD=/Users/stephanbachofen
USER=stephanbachofen
COMMAND_MODE=legacy
SSH_AUTH_SOCK=/tmp/launch-kaPutT/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/usr/local/bin/:/opt/local/bin:/opt/local/sbin:/Applica tions/Apps/maven/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/loca l/bin:/usr/X11/bin
LC_MESSAGES=de_CH.utf-8
LC_COLLATE=de_CH.utf-8
PWD=/System/Library/Frameworks/JavaVM.framework/Versions
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versio ns/1.6/Home/
LANG=de_CH.utf-8
ENVIRONMENT=local
M2_HOME=/Applications/Apps/maven
SHLVL=1
COLORFGBG=0;15
HOME=/Users/stephanbachofen
LOGNAME=stephanbachofen
LC_CTYPE=de_CH.utf-8
DISPLAY=/tmp/launch-wo9UOX/org.x:0
LC_TIME=de_CH.utf-8
_=/usr/bin/env

Other Java applications still work. What doesn't work is Lotus Notes 8.5 which is based on Eclipse as far as I'm aware.
Both, Eclipse and Lotus Notes used to work before the Apple Java update.
Any help is appreciated.

Perhaps a word about the history of this machine: I had JDK 1.5 manually installed as well before but it seems to have gone after the Apple patch.

Cheers,
Stephan




Re: Failed to create the Java Virtual Machine [message #635103 is a reply to message #635099] Mon, 25 October 2010 16:04 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2010.10.25 9:55, Stephan Bachofen wrote:
> [snip]
> Other Java applications still work. What doesn't work is Lotus Notes 8.5
> which is based on Eclipse as far as I'm aware.
> Both, Eclipse and Lotus Notes used to work before the Apple Java update.
> Any help is appreciated.
>
> Perhaps a word about the history of this machine: I had JDK 1.5 manually
> installed as well before but it seems to have gone after the Apple patch.
>
> Cheers,
> Stephan


I personally prescribe downloading and using a separate, private JDK
with Eclipse rather than installing it for use by the greater computer
host. That way, whatever is going on with my computer doesn't influence
the behavior of my Eclipse development (and vice-versa).

I'm not a Mac guy, but it would appear on the basis of what you've said
that my personal practice would be even more relevant on that platform
than on Linux and Windows.

If you choose to do this and get a new JDK for Eclipse use, be sure to
edit eclipse.ini to add the -vm argument so that Eclipse knows where to
get its JDK.
Re: Failed to create the Java Virtual Machine [message #638292 is a reply to message #635103] Wed, 10 November 2010 17:55 Go to previous messageGo to next message
Stephan Bachofen is currently offline Stephan BachofenFriend
Messages: 3
Registered: October 2010
Junior Member
Thanks Russel

The JDK provided by Apple installs at a default location. I can't make it install in another folder. Adding the -VM option with the path didn't fix the problem unfortunately.

I've been using Linux for many years and I've been handling the JDK's the same way as you described. Wink
Re: Failed to create the Java Virtual Machine [message #662407 is a reply to message #638292] Wed, 30 March 2011 14:55 Go to previous messageGo to next message
Dan Kripac is currently offline Dan KripacFriend
Messages: 1
Registered: March 2011
Junior Member
Hi there,

Just thought I'd add to this as I had the same problem after the java 1.6 update on 10.6.7.

It turned out that my problem was due to having my /etc/launchd.conf contain 'umask 007' (As this is the way I prefer unix permissions to be in my situation) which meant that during the java update install, all symlinks were getting created as root:admin user group and were unreadable to anyone else.

Here is how I fixed it (assumes some terminal knowledge - and comes with a not-my-fault-if-this-breaks-your-system disclaimer!).

1) Save the python code below to the file fixSymLinkPermissions.py
2) Open a terminal and cd to /System/Library/Frameworks/JavaVM.framework/
3) run 'sudo /path/to/fixSymLinkPermissions.py'

It should recursively go though all sub-directories and remake all symlinks with umask 000 permissions (prints it out as it goes).

It works for me at least!

Cheers
Dan

#!/usr/bin/env python

# Quick hack fix to recursively re-make symlinks with full permissions
#
# Author : Dan Kripac
# 
# usage:
#     fixSymLinkPermissions.py [ optional_File_Or_Dir_List ]
#
# Defaults to the current working directory if no arguments are given.
#
# Should avoid recursing to linked directories outside the directories
# that you initiate the process from (i.e outside the current working 
# directory by default)
#

import os, sys, threading, signal

symlinkMutex = threading.Lock()

def signalHandle(signum, frame):
	# wait for any symlink operations to finish so we don't leave
	# any removed symlinks unmade
	symlinkMutex.acquire()
	print('Gracefully quiting...')
	sys.exit(1)

signal.signal( signal.SIGTERM, signalHandle )
signal.signal( signal.SIGHUP,  signalHandle )
signal.signal( signal.SIGABRT, signalHandle )
signal.signal( signal.SIGINT,  signalHandle )
signal.signal( signal.SIGQUIT, signalHandle )

def fixSymLinkPermissions( fileList, recursiveLinkDomain=[] ):	
	if os.getuid() != 0:
		if __name__ == '__main__':
			print('fixSymLinkPermissions : ERROR : must be run as super user.')
			sys.exit(1)
		else:
			raise OSError('fixSymLinkPermissions : ERROR : must be run as super user.')
		
	for f in fileList:
		if os.path.exists( f ):
			if os.path.islink( f ):
				try:
					linkLoc = os.readlink( f )
					absLinkLoc = os.path.abspath( linkLoc )
					oldumask = os.umask( 0000 )
					print('Re-creating symlink %r -> %r' % (f,linkLoc) )
					symlinkMutex.acquire()
					try:
						os.remove( f )
						os.symlink( linkLoc, f )
						pass
					finally:
						symlinkMutex.release()
						
					os.umask( oldumask )
					if os.path.isdir( linkLoc ):
						outsideLinkDomain = False
						for p in recursiveLinkDomain:
							relpath = os.path.relpath(absLinkLoc,p)
							if len(relpath) and relpath[0] == '.':
								outsideLinkDomain = True
							elif len(relpath) == 0:
								outsideLinkDomain = True
								
						if not outsideLinkDomain:
							fixSymLinkPermissions( [ absLinkLoc ], recursiveLinkDomain=recursiveLinkDomain )
						else:
							print('skipping recursion to link %r' % absLinkLoc )
						
				except Exception, err:
					print('ERROR : %s creating symlink %r -> %r' % (err,f,linkLoc))
					
			elif os.path.isdir( f ):
				childFileList = []
				for c in os.listdir( f ):
					p = os.path.join( f, c )
					if os.path.exists( p ):
						childFileList.append( p )
					else:
						print('path %r doesn\'t eixist?' % c)
				
				if len(childFileList):
					fixSymLinkPermissions( childFileList, recursiveLinkDomain=recursiveLinkDomain )
		else:
			print('fixSymLinkPermissions : path %r does not exist?' % f )

if __name__ == '__main__':
	if len(sys.argv) == 1:
		fixSymLinkPermissions( [ os.getcwd() ], recursiveLinkDomain=[ os.getcwd() ] )
	else:
		fileList = []
		linkDomain = []
		for f in sys.argv[1:]:
			if not os.path.isabs( f ):
				if os.path.exists( os.path.abspath( f ) ):
					fileList.append( os.path.abspath( f ) )
			elif os.path.exists( f ):
				fileList.append( f )
			
			if os.isdir( fileList[-1] ):
				if not fileList[-1] in linkDomain:
					linkDomain.append( fileList[-1] )
			else:
				parentDir = os.path.split( fileList[-1] )[0]
				if not parentDir in linkDomain:
					linkDomain.append( parentDir )

		fixSymLinkPermissions( fileList, recursiveLinkDomain=linkDomain )



Re: Failed to create the Java Virtual Machine [message #662422 is a reply to message #662407] Wed, 30 March 2011 15:37 Go to previous message
Stephan Bachofen is currently offline Stephan BachofenFriend
Messages: 3
Registered: October 2010
Junior Member
Thanks Dan

My folders permissions look OK though. The weird thing is that maven and netbeans still work. Eclipse, JEdit and Cyberduck do not work any more since that update.

Regards,
Stephan


stephan-bachofens-macbook-pro-2:JavaVM.framework stephanbachofen$ pwd
/System/Library/Frameworks/JavaVM.framework
stephan-bachofens-macbook-pro-2:JavaVM.framework stephanbachofen$ ls -al
total 72
drwxr-xr-x 12 root wheel 408 13 Mär 16:49 .
drwxr-xr-x 95 root wheel 3230 21 Dez 23:21 ..
lrwxr-xr-x 1 root wheel 27 13 Mär 16:47 Classes -> Versions/CurrentJDK/Classes
lrwxr-xr-x 1 root wheel 24 13 Mär 16:47 CodeResources -> Versions/A/CodeResources
lrwxr-xr-x 1 root wheel 28 13 Mär 16:47 Commands -> Versions/CurrentJDK/Commands
lrwxr-xr-x 1 root wheel 27 13 Mär 16:47 Frameworks -> Versions/Current/Frameworks
lrwxr-xr-x 1 root wheel 24 13 Mär 16:47 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 root wheel 24 13 Mär 16:47 Home -> Versions/CurrentJDK/Home
lrwxr-xr-x 1 root wheel 23 13 Mär 16:47 JavaVM -> Versions/Current/JavaVM
lrwxr-xr-x 1 root wheel 29 13 Mär 16:47 Libraries -> Versions/CurrentJDK/Libraries
lrwxr-xr-x 1 root wheel 26 13 Mär 16:47 Resources -> Versions/Current/Resources
drwxr-xr-x 13 root wheel 442 13 Mär 16:49 Versions
stephan-bachofens-macbook-pro-2:JavaVM.framework stephanbachofen$
Previous Topic:Highlight Find results?
Next Topic:at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
Goto Forum:
  


Current Time: Fri Apr 19 09:32:36 GMT 2024

Powered by FUDForum. Page generated in 0.03633 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top