| Summary: | Running formatter from the command line breaks with error | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | panayotis | ||||||||||||
| Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||||||||
| Status: | VERIFIED DUPLICATE | QA Contact: | |||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | amj87.iitr, jarthana, Olivier_Thomann, satyam.kandula | ||||||||||||
| Version: | 3.6.2 | ||||||||||||||
| Target Milestone: | 3.7.1 | ||||||||||||||
| Hardware: | Macintosh | ||||||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
Created attachment 194320 [details]
.settings/org.eclipse.jdt.core.prefs
Created attachment 194321 [details]
.settings/org.eclipse.jdt.ui.prefs file
Comment on attachment 194321 [details]
.settings/org.eclipse.jdt.ui.prefs file
#Fri Apr 29 01:12:15 EEST 2011
eclipse.preferences.version=1
formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
formatter_settings_version=11
Are you formatting aspectJ files ? No, just plain Java files. Do you have aspectJ installed ? Your stacktrace shows aj files. Please paste your installation information so that we can see what is installed and what might cause the problem. Created attachment 194370 [details]
plugins
Attached is a list of plugins (by issuing the command "cd eclipse/plugins ; ls "
PS: I didn't install myself any plugin at all. This is a clean Eclipse installation for Mac OSX. I did this to minimize possible problems. This is not a clean install. You have aspectj and scala: -rw-r--r-- 1 teras staff 98920 Apr 29 00:28 org.aspectj.runtime_1.6.10.20101003133000.jar -rw-r--r-- 1 teras staff 1470572 Apr 29 00:28 org.aspectj.weaver_1.6.10.20101003133000.jar -rw-r--r-- 1 teras staff 9334601 Apr 29 00:29 org.scala-ide.scala.compiler_2.8.1.final-p0003.jar -rw-r--r-- 1 teras staff 8021315 Apr 29 00:29 org.scala-ide.scala.library_2.8.1.final-p0003.jar -rw-r--r-- 1 teras staff 124782 Apr 29 00:28 org.scala-ide.sdt.aspects_1.0.0.201102131804-milestones-M01.jar -rw-r--r-- 1 teras staff 506234 Apr 29 00:28 org.scala-ide.sdt.compiler.ext_1.0.0.201102131804-milestones-M01.jar -rw-r--r-- 1 teras staff 2014919 Apr 29 00:28 org.scala-ide.sdt.core_1.0.0.201102131804-milestones-M01.jar -rw-r--r-- 1 teras staff 1193320 Apr 29 00:28 org.scala-refactoring.library_0.3.0.201104172328.jar -rw-r--r-- 1 teras staff 1742044 Apr 29 00:29 scalariform_0.1.0.201104172333.jar Could you please try with a plain Eclipse SDK to see if you still have the problem ? Created attachment 194376 [details]
plugins list after clean install
hmm I was sure that this was a clean install.
In any case now I try with a fresh install, new plugin list attached
Created attachment 194377 [details]
The test project I am using, just in case...
(In reply to comment #10) > hmm I was sure that this was a clean install. > In any case now I try with a fresh install, new plugin list attached Do you still have the problem with a fresh install ? Any update on this ? Exactly the same behavior... I attached also the plugin list and a test project, just in case. Probably the problem is because I am on a Mac? Should it matter? Mac OS should not change anything. I tried your test case using the project you attached and it works fine. Is the stacktrace identical after you used a fresh install ? The stacktrace in comment 0 clearly shows that aspectJ is causing grief. If you don't install it again, then the error must be different. Without further steps or help to reproduce this issue, I will have to close as WORKSFORME. I created a new (fresh) account.
I also re-downloaded Eclipse, only to use for this clean account, just in case.
The output from the console is as follows:
$ cd Downloads/TestProject/
$ /Users/test/Downloads/eclipse/eclipse -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter -verbose -config .settings/org.eclipse.jdt.core.prefs ./src/
A problem occurred while reading the config file .settings/org.eclipse.jdt.core.prefs.
Usage: eclipse -application org.eclipse.jdt.core.JavaCodeFormatter [ OPTIONS ] -config <configFile> <files>
<files> Java source files and/or directories to format.
Only files ending with .java will be formatted in the given directory.
-config <configFile> Use the formatting style from the specified properties file.
Refer to the help documentation to find out how to generate this file.
OPTIONS:
-help Display this message.
-quiet Only print error messages.
-verbose Be verbose about the formatting job.
ok, I'll try to get a mac to give it a try. It works fine on Linux using a 1.6 VM. What VM are you using on MacOS ? From where are you running the command line ? I could reproduce when the paths to the config file was wrong. Once everything was fine, I could not longer reproduce. java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode) I "cd" in the project path, i.e. if I unzip the file, I do something like "cd TestProject" Or, in other words: $ ls -la total 32 drwxr-xr-x@ 8 demo staff 272 May 12 12:47 . drwx------+ 6 demo staff 204 May 12 12:47 .. -rw-r--r--@ 1 demo staff 6148 May 12 12:47 .DS_Store -rw-r--r--@ 1 demo staff 226 Apr 29 01:12 .classpath -rw-r--r--@ 1 demo staff 370 Apr 29 01:12 .project drwxr-xr-x@ 5 demo staff 170 May 12 12:47 .settings drwxr-xr-x@ 3 demo staff 102 Apr 29 01:12 bin drwxr-xr-x@ 3 demo staff 102 Apr 29 01:12 src If you believe it will help, I could private tell you the credentials to log in to my mac system and have a look. > If you believe it will help, I could private tell you the credentials to log in
> to my mac system and have a look.
I think this is the only way for me to find out what is going on. What is your time zone ?
After investigation, it looks like the problem comes from the relative path used to point to the preferences file. If absolute paths are used, then it runs fine. I'll add some debug statement in verbose mode to try to see what is different on MacOS. Everything works fine on Linux and Windows. I am tagging as 3.7.1 as I am not sure we can properly fix this for 3.7. *** This bug has been marked as a duplicate of bug 340181 *** Satyam, can you please check this on your Mac? Thanks! Verified. |
Build Identifier: M20110210-1200 I am trying to run the formatter from the command line with a command similar to this: /path/to/eclipse -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter -verbose -config .settings/org.eclipse.jdt.core.prefs path/to/java/src Unfortunately I get this error message instead and formatter stops: [org.eclipse.contribution.weaving.jdt] error at org/eclipse/contribution/jdt/IsWovenTester.aj::0 class 'org.eclipse.contribution.jdt.IsWovenTester' is already woven and has not been built in reweavable mode [org.eclipse.contribution.weaving.jdt] error at org/eclipse/contribution/jdt/IsWovenTester.aj::0 class 'org.eclipse.contribution.jdt.IsWovenTester$WeavingMarker' is already woven and has not been built in reweavable mode [org.eclipse.jdt.core] warning at org/eclipse/contribution/jdt/sourceprovider/SourceTransformerAspect.aj:106::0 does not match because declaring type is org.eclipse.jdt.core.IOpenable, if match desired use target(org.eclipse.jdt.core.ICompilationUnit) [Xlint:unmatchedSuperTypeInCall] see also: org/eclipse/jdt/internal/core/SourceRefElement.java:198::0 A problem occurred while reading the config file .settings/org.eclipse.jdt.core.prefs. Usage: eclipse -application org.eclipse.jdt.core.JavaCodeFormatter [ OPTIONS ] -config <configFile> <files> <files> Java source files and/or directories to format. Only files ending with .java will be formatted in the given directory. -config <configFile> Use the formatting style from the specified properties file. Refer to the help documentation to find out how to generate this file. OPTIONS: -help Display this message. -quiet Only print error messages. -verbose Be verbose about the formatting job. Reproducible: Always Steps to Reproduce: 1. Create a new java project 2. Open preferences, select specific formatting for this project 3. Close eclipse 4. Run the above command