通过AppleScript

时间:2018-10-24 15:47:52

标签: eclipse bash macos pydev spring-tool-suite

我可以在Mac上通过命令行打开STS实例:

open -a /Applications/STS.app --args -data ~/abc/spring-security/ -clean -showlocation  -vmargs -Xmx1024m -XX:MaxPermSize=256m

但是,一旦我尝试将其包装为AppleScript,它就会停止工作:

do shell script "open -a /Applications/STS.app --args -data ~/abc/spring-security/ -clean -showlocation  -vmargs -Xmx1024m -XX:MaxPermSize=256m"

具有以下内容:

!SESSION 2018-10-24 10:27:37.172 -----------------------------------------------
eclipse.buildId=3.9.3.201803200915-RELEASE-e47
java.version=1.8.0_161
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.springsource.sts.ide -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.springsource.sts.ide -data /Users/simeonleyzerzon/abc/spring-security/ -clean -showlocation

!ENTRY org.eclipse.ui 2 0 2018-10-24 10:27:49.063
!MESSAGE Warnings while parsing the images from the 'org.eclipse.ui.commandImages' extension point.
!SUBENTRY 1 org.eclipse.ui 2 0 2018-10-24 10:27:49.063
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.lsp4e', id='org.eclipse.lsp4e.togglehighlight'

!ENTRY org.eclipse.core.net 1 0 2018-10-24 10:27:49.243
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences

!ENTRY org.eclipse.jface 2 0 2018-10-24 10:27:54.986
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2018-10-24 10:27:54.986
!MESSAGE A conflict occurred for ALT+COMMAND+R:
Binding(ALT+COMMAND+R,
    ParameterizedCommand(Command(org.python.pydev.debug.setnext,Set Next Statement,
        ,
        Category(org.python.pydev.ui.category.run,PyDev - Run,Python run category,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6b84508a,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)
Binding(ALT+COMMAND+R,


ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring ,
            Rename the selected element,
            Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
            org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@3c48334b,
            ,,true),null),
        org.eclipse.ui.defaultAcceleratorConfiguration,
        org.eclipse.ui.contexts.window,,cocoa,system)
    !SUBENTRY 1 org.eclipse.jface 2 0 2018-10-24 10:27:54.986
    !MESSAGE A conflict occurred for COMMAND+SHIFT+T:
    Binding(COMMAND+SHIFT+T,
        ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
            Open a type in a Java editor,
            Category(org.eclipse.ui.category.navigate,Navigate,null,true),
            org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@16923216,
            ,,true),null),
        org.eclipse.ui.defaultAcceleratorConfiguration,
        org.eclipse.ui.contexts.window,,,system)
    Binding(COMMAND+SHIFT+T,
        ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
            ,
            Category(org.eclipse.lsp4e.category,Language Servers,null,true),
            org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@85a94c8,
            ,,true),null),
        org.eclipse.ui.defaultAcceleratorConfiguration,
        org.eclipse.ui.contexts.window,,,system)

    !ENTRY org.eclipse.ui 2 2 2018-10-24 10:27:56.170
    !MESSAGE org.eclipse.jdt.junit.ResultView: Deprecated relationship "fast" should be converted to "stack".

    !ENTRY org.eclipse.ui 2 2 2018-10-24 10:27:56.171
    !MESSAGE org.springframework.ide.eclipse.aop.ui.navigator.aopReferenceModelNavigator: Deprecated relationship "fast" should be converted to "stack".

    !ENTRY org.eclipse.ui 2 2 2018-10-24 10:27:56.171
    !MESSAGE org.eclipse.contribution.xref.ui.views.XReferenceView: Deprecated relationship "fast" should be converted to "stack".

    !ENTRY org.eclipse.jface.text 2 0 2018-10-24 10:27:57.578
    !MESSAGE Duplicate template id: 'org.eclipse.wst.xslt.templates.xpath.number'

    !ENTRY org.eclipse.jface.text 2 0 2018-10-24 10:27:57.579
    !MESSAGE Duplicate template id: 'org.eclipse.wst.xslt.templates.xpath.round'

    !ENTRY org.jkiss.dbeaver.model 2 0 2018-10-24 10:28:00.355
    !MESSAGE Project 'RemoteSystemsTempFiles' not found in registry
    !SESSION 2018-10-24 10:37:18.756 -----------------------------------------------
    eclipse.buildId=3.9.3.201803200915-RELEASE-e47
    java.version=10
    java.vendor=Oracle Corporation
    BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
    Framework arguments:  -product org.springsource.sts.ide -showlocation
    Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.springsource.sts.ide -data /Users/simeonleyzerzon/abc/spring-security/ -clean -showlocation

    !ENTRY org.eclipse.osgi 4 0 2018-10-24 10:37:31.529
    !MESSAGE Application error
    !STACK 1
    org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:410)
        at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:491)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:505)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:204)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:614)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
    Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
        at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
        ... 22 more
    Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 24 more

    !ENTRY org.eclipse.e4.ui.workbench 4 0 2018-10-24 10:37:31.537
    !MESSAGE FrameworkEvent ERROR
    !STACK 0
    java.lang.NoClassDefFoundError: javax/annotation/PreDestroy
        at org.eclipse.e4.core.internal.di.InjectorImpl.disposed(InjectorImpl.java:450)
        at org.eclipse.e4.core.internal.di.Requestor.disposed(Requestor.java:156)
        at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:78)
        at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:111)
        at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.handleInvalid(TrackableComputationExt.java:74)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:178)
        at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.dispose(EclipseContextOSGi.java:99)
        at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.bundleChanged(EclipseContextOSGi.java:141)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112)
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168)
        at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
        at org.eclipse.osgi.container.Module.doStop(Module.java:634)
        at org.eclipse.osgi.container.Module.stop(Module.java:498)
        at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:202)
        at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)
        at java.base/java.lang.Thread.run(Thread.java:844)
    Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 21 more
    !SESSION 2018-10-24 10:37:46.365 -----------------------------------------------
    eclipse.buildId=3.9.3.201803200915-RELEASE-e47
    java.version=10
    java.vendor=Oracle Corporation
    BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
    Framework arguments:  -product org.springsource.sts.ide -showlocation
    Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.springsource.sts.ide -data /Users/simeonleyzerzon/abc/spring-security/ -clean -showlocation

    !ENTRY org.eclipse.osgi 4 0 2018-10-24 10:37:57.312
    !MESSAGE Application error
    !STACK 1
    org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:410)
        at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:491)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:505)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:204)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:614)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
    Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
        at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
        ... 22 more
    Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 24 more

    !ENTRY org.eclipse.e4.ui.workbench 4 0 2018-10-24 10:37:57.319
    !MESSAGE FrameworkEvent ERROR
    !STACK 0
    java.lang.NoClassDefFoundError: javax/annotation/PreDestroy
        at org.eclipse.e4.core.internal.di.InjectorImpl.disposed(InjectorImpl.java:450)
        at org.eclipse.e4.core.internal.di.Requestor.disposed(Requestor.java:156)
        at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:78)
        at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:111)
        at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.handleInvalid(TrackableComputationExt.java:74)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:178)
        at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.dispose(EclipseContextOSGi.java:99)
        at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.bundleChanged(EclipseContextOSGi.java:141)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112)
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168)
        at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
        at org.eclipse.osgi.container.Module.doStop(Module.java:634)
        at org.eclipse.osgi.container.Module.stop(Module.java:498)
        at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:202)
        at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)
        at java.base/java.lang.Thread.run(Thread.java:844)
    Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 21 more


How does one create a script to start Eclipse (STS) on a Mac?  I'm trying to replicate on a Mac a similar behavior of a Windows batch file, e.g.: 

    start /B C:\sts-bundle\sts-3.8.4.RELEASE\STS.exe -data %~dp0 -clean -showlocation -vmC:\Java\java-8 -vmargs -Xmx1024m -XX:MaxPermSize=256m -javaagent:"C:\Users\Simeon\.m2\repository\org\projectlombok\lombok\1.16.8\lombok-1.16.8.jar" -Xbootclasspath/a:"C:\Users\Simeon\.m2\repository\org\projectlombok\lombok\1.16.8\lombok-1.16.8.jar"

Any pointers and best practices in AppleScript are appreciated.

更新:

按照@ greg-449的评论,我已经在脚本编辑器中更新了命令(删除了空格):

do shell script "open -a /Applications/STS.app --args -data ~/abc/spring-security/ -clean -showlocation  -vm 
/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk -vmargs -Xmx1024m -XX:MaxPermSize=256m"

其中:

  1. 弹出一个错误对话框(具有相同的内容,然后保留在Apple Script Editor中):

错误“ sh:第1行:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk:是目录”,编号126

  1. 允许STS打开(与以前不同)

  2. 在STS的.metadata/.log中包含以下错误:

    !会议2018-10-24 21:03:22.116 ----------------------------------- ------------ eclipse.buildId = 3.9.3.201803200915-RELEASE-e47 java.version = 10 java.vendor = Oracle Corporation BootLoader常数:OS = macosx,ARCH = x86_64,WS = cocoa,NL = en_US框架参数:-product org.springsource.sts.ide命令行参数:-os macosx -ws可可 -arch x86_64 -product org.springsource.sts.ide -data / Users / simeonleyzerzon / abc / spring-security / -clean

    !ENTRY org.eclipse.ui 2 0 2018-10-24 21:03:37.575!MESSAGE从org.eclipse.ui.commandImages扩展点解析图像时发出警告。 !SUBENTRY 1 org.eclipse.ui 2 0 2018-10-24 21:03:37.575!MESSAGE无法绑定到未定义的命令:plugin-in ='org.eclipse.lsp4e',id ='org.eclipse.lsp4e。 togglehighlight'

    !ENTRY org.eclipse.core.net 1 0 2018-10-24 21:03:37.846!MESSAGE系统属性http.nonProxyHosts已设置为local | .local | 169.254 / 16 | .169.254 / 16由外部来源提供。该值将被使用首选项中的值覆盖

    !ENTRY org.eclipse.jface 2 0 2018-10-24 21:03:45.223!MESSAGE发生键绑定冲突。它们可能会干扰加速器的正常运行。 !SUBENTRY 1 org.eclipse.jface 2 0 2018-10-24 21:03:45.224!MESSAGE ALT + COMMAND + R发生冲突:Binding(ALT + COMMAND + R,ParameterizedCommand(Command(org.python.pydev。 debug.setnext,设置下一条语句,类别(org.python.pydev.ui.category.run,PyDev-运行,Python运行类别,true),org.eclipse.ui.internal.WorkbenchHandlerServiceHandler @ a0682a3,``true) ,null),org.eclipse.ui.defaultAcceleratorConfiguration,org.eclipse.ui.contexts.window ,, system)绑定(ALT + COMMAND + R,ParameterizedCommand(Command(org(ec.eclipse.jdt.ui.edit.text。 java.rename.element,重命名  重构,重命名选定的元素,Category(org.eclipse.jdt.ui.category.refactoring,Refactor-Java,Java Refactoring Actions,true),org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1f018208,,, true),null ),org.eclipse.ui.defaultAcceleratorConfiguration,org.eclipse.ui.contexts.window ,, cocoa,system)!SUBENTRY 1 org.eclipse.jface 2 0 2018-10-24 21:03:45.224!MESSAGE发生冲突对于COMMAND + SHIFT + T:绑定(COMMAND + SHIFT + T,ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,在Java编辑器中打开一个类型,Category(org.eclipse。 ui.category.navigate,Navigate,null,true),org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@801c0e8,,, true),null),org.eclipse.ui.defaultAcceleratorConfiguration,org.eclipse.ui.contexts.window ,,, system)绑定(COMMAND + SHIFT + T,ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,,Category(org.ecli pse.lsp4e.category,语言服务器,null,true),org.eclipse.ui.internal.WorkbenchHandlerServiceHandler @ 5aa2493f,``,true),null),org.eclipse.ui.defaultAcceleratorConfiguration,org.eclipse.ui.contexts。窗口,系统)

    !ENTRY org.eclipse.ui 2 2 2018-10-24 21:03:46.694!MESSAGE org.eclipse.jdt.junit.ResultView:过时的关系“快速”应转换为“堆栈”。

    !ENTRY org.eclipse.ui 2 2 2018-10-24 21:03:46.695!MESSAGE org.springframework.ide.eclipse.aop.ui.navigator.aopReferenceModelNavigator:不建议使用的关系“快速”应转换为“堆栈”。

    !ENTRY org.eclipse.ui 2 2 2018-10-24 21:03:46.695!MESSAGE org.eclipse.contribution.xref.ui.views.XReferenceView:过时的关系“快速”应转换为“堆栈”

    !ENTRY org.eclipse.jface.text 2 0 2018-10-24 21:03:48.503!MESSAGE重复的模板ID:'org.eclipse.wst.xslt.templates.xpath.number'

    !ENTRY org.eclipse.jface.text 2 0 2018-10-24 21:03:48.504!MESSAGE重复的模板ID:'org.eclipse.wst.xslt.templates.xpath.round'

    !ENTRY org.jkiss.dbeaver.model 2 0 2018-10-24 21:03:51.613!MESSAGE项目'RemoteSystemsTempFiles'在注册表中找不到

看起来我相处得还不错,但仍然存在一些问题。是的,我确实安装了PyDev,DBeaver插件,到目前为止还没有引起问题。

===

按照马丁的建议,我试图指出Java可执行文件是Apple脚本:

do shell script "open -a /Applications/STS.app --args -data ~/abc/spring-security/ -clean -showlocation  -vm 
/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/java -vmargs -Xmx1024m -XX:MaxPermSize=256m"

现在,脚本编辑器抱怨以下内容:

error "Unrecognized option: -vmargs
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit." number 1

新的工作区(和STS实例)是使用以下命令创建的(看起来与以前的尝试非常相似,但未指向Java exec:

!SESSION 2018-10-25 13:52:05.053 -----------------------------------------------
eclipse.buildId=3.9.3.201803200915-RELEASE-e47
java.version=10
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.springsource.sts.ide
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.springsource.sts.ide -data /Users/simeonleyzerzon/abc/spring-security/ -clean

!ENTRY org.eclipse.ui 2 0 2018-10-25 13:52:20.096
!MESSAGE Warnings while parsing the images from the 'org.eclipse.ui.commandImages' extension point.
!SUBENTRY 1 org.eclipse.ui 2 0 2018-10-25 13:52:20.096
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.lsp4e', id='org.eclipse.lsp4e.togglehighlight'

!ENTRY org.eclipse.core.net 1 0 2018-10-25 13:52:20.356
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences

!ENTRY org.eclipse.jface 2 0 2018-10-25 13:52:26.785
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2018-10-25 13:52:26.786
!MESSAGE A conflict occurred for ALT+COMMAND+R:
Binding(ALT+COMMAND+R,
    ParameterizedCommand(Command(org.python.pydev.debug.setnext,Set Next Statement,
        ,
        Category(org.python.pydev.ui.category.run,PyDev - Run,Python run category,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7a8623b1,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)
Binding(ALT+COMMAND+R,
    ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring ,
        Rename the selected element,
        Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@3b2fac55,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,cocoa,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2018-10-25 13:52:26.786
!MESSAGE A conflict occurred for COMMAND+SHIFT+T:
Binding(COMMAND+SHIFT+T,
    ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
        Open a type in a Java editor,
        Category(org.eclipse.ui.category.navigate,Navigate,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@4866eb17,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)
Binding(COMMAND+SHIFT+T,
    ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
        ,
        Category(org.eclipse.lsp4e.category,Language Servers,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@45b94c10,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)

!ENTRY org.eclipse.ui 2 2 2018-10-25 13:52:28.210
!MESSAGE org.eclipse.jdt.junit.ResultView: Deprecated relationship "fast" should be converted to "stack".

!ENTRY org.eclipse.ui 2 2 2018-10-25 13:52:28.213
!MESSAGE org.springframework.ide.eclipse.aop.ui.navigator.aopReferenceModelNavigator: Deprecated relationship "fast" should be converted to "stack".

!ENTRY org.eclipse.ui 2 2 2018-10-25 13:52:28.213
!MESSAGE org.eclipse.contribution.xref.ui.views.XReferenceView: Deprecated relationship "fast" should be converted to "stack".

!ENTRY org.eclipse.jface.text 2 0 2018-10-25 13:52:30.187
!MESSAGE Duplicate template id: 'org.eclipse.wst.xslt.templates.xpath.number'

!ENTRY org.eclipse.jface.text 2 0 2018-10-25 13:52:30.187
!MESSAGE Duplicate template id: 'org.eclipse.wst.xslt.templates.xpath.round'

!ENTRY org.jkiss.dbeaver.model 2 0 2018-10-25 13:52:32.968
!MESSAGE Project 'RemoteSystemsTempFiles' not found in registry

顺便说一下,过去(在Windows计算机上)我总是指向Java的家园,它从不抱怨,也从未抱怨-vm之后没有空格:

start /B C:\sts-bundle\sts-3.8.4.RELEASE\STS.exe -data %~dp0 -clean -showlocation -vmC:\Java\java-8 -vmargs -Xmx1024m -XX:MaxPermSize=256m -javaagent:"C:\Users\Simeon\.m2\repository\org\projectlombok\lombok\1.16.8\lombok-1.16.8.jar" -Xbootclasspath/a:"C:\Users\Simeon\.m2\repository\org\projectlombok\lombok\1.16.8\lombok-1.16.8.jar"

1 个答案:

答案 0 :(得分:0)

我在用于Eclipse发行版的最新Spring Tools 4中进行了尝试,它似乎运行良好。这是我的工作,我认为重要的事情:

  • 首先尝试纯命令行,然后在其中包含-vm选项。

我尝试了这一点,并且工作正常,使用指定的JDK开始分发:

open -a /sts4r/SpringToolSuite4.app --args -vm /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/java -data ~/Documents/workspace-from-command-line1/ -clean -showlocation -vmargs -Xmx1024m -XX:MaxPermSize=256m

请注意,-vm选项是--args之后的第一个选项,我认为这很重要。

  • 然后我像您一样将其包装在Apple脚本中:

do shell script "open -a /sts4r/SpringToolSuite4.app --args -vm /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/java -data ~/Documents/workspace-from-command-line1/ -clean -showlocation -vmargs -Xmx1024m -XX:MaxPermSize=256m"

这也可以(在脚本编辑器中尝试过)。

尽管如此,我还是建议您使用JDK 8(而不是我在这里使用的JDK 10)运行STS安装。

希望这会有所帮助!