How to fix the problem that Aptana Studio does not start

Event that occurred

When I tried to start Aptana Studio, the following dialog was displayed. スクリーンショット 2019-01-05 13.13.47.png

Looking at the log file shown in the dialog, the following error occurred.

log:.metadata/.log


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 com.aptana.rcp.IDEApplication.start(IDEApplication.java:126)
        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:566)
        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:521)
        ... 24 more

!ENTRY org.eclipse.e4.ui.workbench 4 0 2019-01-05 13:11:00.566
!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:834)
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:521)
        ... 21 more

Cause

The default Java version was Java 11. When I checked the Java version used by default, It was Java 11 as shown below.

Check the JDK used by default


$ java --version
openjdk 11.0.1 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

Solution

As a premise, AptanaStudio (or eclipse) uses Java at startup. If it is Java8, it will start normally, so specify the JDK version when starting Aptana Studio directly.

1. Check the installed JDK

You can check the currently installed JDK with the following command.

Check installed JDK


$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
    11.0.1, x86_64:	"OpenJDK 11.0.1"	/Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
    1.8.0_181, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home

2. Specify Java 8 as the JDK when starting Aptana Studio

Info.plist exists in AptanaStudio.app, so edit that file.

xml:/Applications/AptanaStudio.app/Contents/Info.plist


<key>Eclipse</key>
  <array>
    <!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options,
         or add a VM found via $/usr/libexec/java_home -V
      <string>-vm</string><string>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>-->
      <string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java</string>
      <string>-keyring</string>
      <string>~/.eclipse_keyring</string>
  </array>

Edit the argument of -vm as above. (It should be commented out at first) The specified value may be specified by referring to the path confirmed in "1. Confirmation of installed JDK" above.

You can now start Aptana Studio.

Recommended Posts

How to fix the problem that Aptana Studio does not start
How to get the log when install4j does not start
How to interact with a server that does not crash the app
[Error] How to resolve the event that the screen does not transition after editing
[Android Studio] [Java] How to fix the screen vertically
How to fix the problem that the upper half is cut off when using UITabBar
[Rails] The problem that pry-byebug does not stop through breakpoints
[Rails] Solving the problem that session timeout does not work
How to solve the problem that you can not pull image from docker hub with Minikube
How to solve the problem that the website image is not displayed after deploying to heroku on Rails 5
How to solve the problem that notification cannot be requested on iOS14
How to solve the problem that it is not processed normally when nesting beans in Spring Batch
How to make @Transactional work that does not work if you use it incorrectly
[Grails] Error occurred running What to do when the Grails CLI does not start
[Swift] How to simply describe dismiss that was not taught in the introductory book
Terminal does not start
[Beginner] Discover the N + 1 problem! How to use Bullet
How to place a button that does not move by scrolling on TableView etc.
[Java] The problem that uploaded images are not updated due to the influence of cache
When the server does not start with rails s
The story that led to solving the error because postgres did not start with docker-compose up
How to solve the problem when the value is not sent when the form is disabled in rails and sent
Use cryptographically secure pseudo-random numbers to verify that the solution to the Monty Hall problem is not 50%
How to take a screenshot with the Android Studio emulator
How to replace characters that you do not understand [Principle]
[Firebase] The problem that the currentUser of Firebase Auth does not become null even if the app is uninstalled.
About the solution to the problem that the log of logback is not output when the web application is stopped
If the DB container does not start with Initializing database files
Solved the problem that the scroll event did not fire in JQuery
The problem that XML attributes are sorted arbitrarily in Android Studio
About the matter that I was addicted to how to use hashmap
How to identify the path that is easy to make a mistake
The operator that was born to be born, instanceof (Java) ~ How to use the instanceof operator ~
Correspond to "error that basic authentication does not pass" in the test code "The story that could not be done"
[Rails] How to solve the problem that the default image is overwritten when editing without uploading the image [Active Storage]
How to use the link_to method
Docker test DB does not start
How to use the include? method
How to find the average angle
How to use the wrapper class
How to add the delete function
Container does not start with docker-compose
How to start Camunda with Docker
[Bootstrap] How to use the "grid system" that supports responsive web design
About the problem that the server can not be started with rails s
[Docker] How to solve the error function not implemented @ io_fread ~ [Super easy]
How to constrain the action of the transition destination when not logged in
How to not start Flyway when running unit tests in Spring Boot