Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 5933

Summary: Eclipse requires write permissions to the install directory
Product: [Eclipse Project] Platform Reporter: Johan Walles <johan.walles>
Component: ResourcesAssignee: DJ Houghton <dj.houghton>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: cpjunk, manahan, olo
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Johan Walles CLA 2001-11-14 16:11:20 EST
As root:

Install eclipse-SDK-20011107-linux-motif.zip in /usr/local/lib/eclipse.  Fix the
permission problems described in bug 5926.

As any (other) user:

cd /usr/local/lib/eclipse
./eclipse

Expected result:

Eclipse should start.

Actual result:

Splash screen appears.
Splash screen goes away and Eclipse dies with the following error:

Exception launching the Eclipse Platform:
java.lang.reflect.InvocationTargetException:
java.lang.reflect.InvocationTargetException:
org.eclipse.core.runtime.CoreException: The platform metadata area could not be
written: /usr/local/lib/eclipse/workspace/.metadata.
	at
org.eclipse.core.internal.runtime.PlatformMetaArea.createLocation(PlatformMetaArea.java:60)
	at
org.eclipse.core.internal.runtime.InternalPlatform.setupMetaArea(InternalPlatform.java:842)
	at
org.eclipse.core.internal.runtime.InternalPlatform.loaderStartup(InternalPlatform.java:571)
	at java.lang.reflect.Method.invoke(Native Method)
	at
org.eclipse.core.internal.boot.InternalBootLoader.startup(InternalBootLoader.java:917)
	at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:808)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
	at org.eclipse.core.launcher.Main.run(Main.java:502)
	at org.eclipse.core.launcher.Main.main(Main.java:362)

The core exception says that Eclipse wants to write to
/usr/local/lib/eclipse/workspace/.metadata.  The correct location for this
information should be somewhere it the user's home directory.  I'd suggest
~/.eclipse if the .metadata directory contains Eclipse settings.
Comment 1 John Arthorne CLA 2001-11-14 16:30:31 EST
The installation instructions in the readme file states that you should specify 
the workspace directory using the -data argument in such an environment.  For 
example:

./eclipse -data ~/my_workspace

Workspace content and meta-data will then go under ~/my_workspace
Comment 2 Johan Walles CLA 2001-11-15 02:57:52 EST
In that case I would appreciate if you could:

a) Preferrably change the default behaviour to put the data files in the user's
home directory like most (all?) other Unix applications.

b) If a) is not possible for some reason, come up with a better error message
(suggesting the -data switch) instead of the below exception.
Documenting non-standard behaviour is an OK stop-gap solution, but it is
*definitely not* a permanent solution to this problem as you seem to suggest.
Comment 3 John Arthorne CLA 2002-03-20 15:28:03 EST
Fixed.  The error message now says,

"The platform metadata area could not be written: {0}.  By default the platform 
writes its content under the current working directory when the platform is 
launched.  Use the -data parameter to specify a different content area for the 
platform."
Comment 4 Corey Puffalt CLA 2002-10-15 12:53:58 EDT
This bug does not appear to be fixed for me with eclipse-gtk 2.0.1 on redhat 8
w/ jdk1.4.1.  I do not get the error message noted in the previous note.  Here's
the (uninformative) stacktrace I get:

eclipse
An exception occurred while writing to the platform log:
java.io.FileNotFoundException: /usr/local/eclipse-2.0.1/workspace/.metadata/.log
(No such file or directory)
        at java.io.FileOutputStream.openAppend(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:174)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
        at org.eclipse.core.launcher.Main.openLogFile(Main.java:1356)
        at org.eclipse.core.launcher.Main.log(Main.java:1217)
        at org.eclipse.core.launcher.Main.main(Main.java:543)
Logging to the console instead.
!ENTRY org.eclipse.core.launcher 4 0 Oct 15, 2002 10:56:29.877
!MESSAGE Exception launching the Eclipse Platform:
An exception occurred while writing to the platform log:
java.io.FileNotFoundException: /usr/local/eclipse-2.0.1/workspace/.metadata/.log
(No such file or directory)
        at java.io.FileOutputStream.openAppend(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:174)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
        at org.eclipse.core.launcher.Main.openLogFile(Main.java:1356)
        at org.eclipse.core.launcher.Main.log(Main.java:1217)
        at org.eclipse.core.launcher.Main.main(Main.java:544)
Logging to the console instead.
!STACK
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
        at org.eclipse.core.launcher.Main.run(Main.java:703)
        at org.eclipse.core.launcher.Main.main(Main.java:539)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.eclipse.core.internal.boot.InternalBootLoader.startup(InternalBootLoader.java:909)
        at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:768)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
        ... 7 more
Caused by: org.eclipse.core.runtime.CoreException: The platform metadata area
could not be written: /usr/local/eclipse-2.0.1/workspace/.metadata.  By default
the platform writes its content
under the current working directory when the platform is launched.  Use the
-data parameter to
specify a different content area for the platform.
        at
org.eclipse.core.internal.runtime.PlatformMetaArea.createLocation(PlatformMetaArea.java:72)
        at
org.eclipse.core.internal.runtime.InternalPlatform.setupMetaArea(InternalPlatform.java:886)
        at
org.eclipse.core.internal.runtime.InternalPlatform.loaderStartup(InternalPlatform.java:557)
        ... 14 more
Comment 5 Corey Puffalt CLA 2002-10-15 12:55:50 EDT
Oops...blonde moment.  The message *is* hidden in the stacktrace. Could it be
made more prominent instead of being hidden in the stacktrace?
Comment 6 Johan Walles CLA 2002-11-21 09:49:20 EST
Reopening because of Corey's problems.  Eclipse shouldn't crash upon launch in a
multi-user install (even if there's a helpful message hidden inside the stack
traces).
Comment 7 Jeffrey Yasskin CLA 2003-01-05 01:49:16 EST
This bug still exists in 2.0.2. Worse, if it is encountered in an X-session
whose current directory isn't writable, the error dialog says: 
"Problems during startup. Check the ".log" file in the ".metadata" directory of
your workspace."
This file, of course, doesn't exist.

Why does it default to the current directory rather than the user's home directory?
Comment 8 a korsman CLA 2003-01-30 18:21:19 EST
For what it's worth this is a REALLY high impact bug. We recently deployed into 
a multi-user, multi-machine environment (~20 people) and everyone bumps into 
this the first time they start up.  ...  AK
Comment 9 DJ Houghton CLA 2003-03-27 10:49:17 EST

*** This bug has been marked as a duplicate of 33976 ***