java.lang.UnsupportedClassVersionError: bad major version at offset=6 - apache

I have deployed a WAR file in the webapps folder in my tomcat. And when I am starting my tomcat, like below
C:\apache-tomcat-6.0.35\bin>startup.bat
Using CATALINA_BASE: "C:\apache-tomcat-6.0.35"
Using CATALINA_HOME: "C:\apache-tomcat-6.0.35"
Using CATALINA_TMPDIR: "C:\apache-tomcat-6.0.35\temp"
Using JRE_HOME: "C:\Program Files (x86)\IBM\RationalSDLC\Common\Java5.0\jre"
Using CLASSPATH: "C:\apache-tomcat-6.0.35\bin\bootstrap.jar"
I am getting this below exception-
SEVERE: Error deploying web application archive DirectoryServer.war
java.lang.UnsupportedClassVersionError: (com/services/rest/Listener) bad major version at offset=6 (unable to load class com.services.rest.Listener)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2822)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebAnnotationSet.java:145)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:73)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:56)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:297)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1078)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4612)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
And this is my JAVA version-
C:\apache-tomcat-6.0.35\bin>java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
Can anyone provide any suggestion why is it happening?

You have essentially compiled your code with JDK 1.6 but running it with Java 5 - Just ensure a Java 6 runtime.

Even I faced same problem. The problem is inappropriate class version, for ex. compiling with different jre.
Solution: IF you are using Eclipse or RAD, set change compiler setting as per your requirement and also change same setting to project configuration by clicking on "Configure Project specific setting". Windows->Preferences->Compiler-> click on link "Configure Project specific setting".

For me the fix was to set the JAVA_Home system variable to the correct path.

It is a compiler issue. Make sure all your modules are configured with java 1.5 as a compiler. Window-->preference--> Java --> Compiler. Make sure 1.5 is selected.

Related

Problems in IntelliJ since version 2022.1 / java.lang.NoClassDefFoundError

As of today, when I try to run some of my programs in IntelliJ today, this message was shown:
Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Running 'before' tasks
Checking sources
Finished, saving caches…
Module 'Listen' production: java.lang.NoClassDefFoundError: com/intellij/DynamicBundle
Executing post-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Synchronizing output directories...
13.04.22, 14:54 - Build completed with 1 error and 0 warnings in 4 sec, 39 ms
This line is printed in red: Module 'Listen' production: java.lang.NoClassDefFoundError: com/intellij/DynamicBundle
I don't really have too much of an idea where I should look for the problem.
It seems to not have anything to do with the project itself. I already created a new Project and created a Hello World-program, which resulted in the same error.
Remarkably, yesterday my IntelliJ IDEA version was updated to version 2022.1.
Runtime version: 11.0.14.1+1-b2043.25 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
I have no idea either whether it has anything to do with the new version either.
I maintain another Project, which uses Scala language. That one is messed up even more:
Cannot process toolwindow sbt
java.lang.AbstractMethodError: Missing implementation of resolved method 'abstract com.intellij.openapi.externalSystem.settings.AbstractExternalSystemSettings getSettings(com.intellij.openapi.project.Project)' of abstract class com.intellij.openapi.externalSystem.service.task.ui.AbstractExternalSystemToolWindowFactory.
at com.intellij.openapi.externalSystem.service.task.ui.AbstractExternalSystemToolWindowFactory.shouldBeAvailable(AbstractExternalSystemToolWindowFactory.java:35)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.beanToTask(ToolWindowSetInitializer.kt:262)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.beanToTask(ToolWindowSetInitializer.kt:248)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.access$beanToTask(ToolWindowSetInitializer.kt:1)
at com.intellij.toolWindow.ToolWindowSetInitializerKt$computeToolWindowBeans$1.accept(ToolWindowSetInitializer.kt:278)
at com.intellij.toolWindow.ToolWindowSetInitializerKt$computeToolWindowBeans$1.accept(ToolWindowSetInitializer.kt)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processWithPluginDescriptor(ExtensionPointImpl.java:301)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.computeToolWindowBeans(ToolWindowSetInitializer.kt:274)
at com.intellij.toolWindow.ToolWindowSetInitializer$1.get(ToolWindowSetInitializer.kt:101)
at com.intellij.toolWindow.ToolWindowSetInitializer$1.get(ToolWindowSetInitializer.kt:83)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Any advice?
Best
Stapelüberläufer
I had the same problem after upgrading to Intellij 2022.1
For me, the fix came from Gen's answer. I also had an old Scala plugin, and just removed it as I'm not using it anymore.
If you are looking to upgrade it, go to File -> Settings -> Plugins. From there just hit Upgrade for the plugins you want. After that restart the IDE.
I found that Scala plugin was not updated and updating it to at least version 2022.1.13 fixed it for me.
I upgraded to Intellij 2022.1 and encountered this issue when trying to sync the old gradles projects that used to work for me :
Caused by: java.lang.NoClassDefFoundError: org/gradle/internal/impldep/com/google/common/collect/Lists
Cleaning the caches folder's content (Gradle_HOME/caches) resolved this issue for me
Make sure to also check that the SDK is correctly configured for your project (Java 17 by default) and the Gradle home is well specified in the Settings>Gradle section.
For info, I'm using Java 8 and Gradle 5.5.1 (yes I know :))
Just upgrade the Scala Plugin and its done!
visiting
scala plugin's page
and install it from there worked for me on ultimate version 2022.2.3

How to link Z3 build, Compiled for Java, from Eclipse Plugin?

I have a perfectly working Z3 Build system for Java. I want to call it from an Eclipse plugin. I tried several approaches, but non of them are working for me. These approaches are:
Adding Z3 build as an external class folder
How to Use External Class Files in an Eclipse Project
Exception in thread "main" java.lang.UnsatisfiedLinkError: no
libz3java in java.library.path at
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at
java.lang.Runtime.loadLibrary0(Runtime.java:870) at
java.lang.System.loadLibrary(System.java:1122) at
com.microsoft.z3.Native.(Native.java:14) at
com.microsoft.z3.Global.ToggleWarningMessages(Global.java:87) at
TestZ3.main(TestZ3.java:9)
Copied Z3 build to the Eclipse plugin, at the root. Then added com.microsoft.z3.jar under the Libraries (Right-mouth click on the project->Build Path->Configure Build Path->Libraries->Add Jars). The error is:
java.lang.UnsatisfiedLinkError: no libz3java in java.library.path at
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at
java.lang.Runtime.loadLibrary0(Runtime.java:870) at
java.lang.System.loadLibrary(System.java:1122) at
com.microsoft.z3.Native.(Native.java:14) at
com.microsoft.z3.Global.ToggleWarningMessages(Global.java:87) at
plugintest.handlers.SampleHandler.execute(SampleHandler.java:37) at
org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
at
org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at
org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
at
org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
at
org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at
org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
at
org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
at
org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
at
org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
at
org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:799)
at
org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:675)
at
org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$7(HandledContributionItem.java:659)
at
org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:592)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362) at
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113) at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694) at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)
at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
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:380)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at
org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at
org.eclipse.equinox.launcher.Main.run(Main.java:1515) at
org.eclipse.equinox.launcher.Main.main(Main.java:1488)
With or without the previous step, I added com.microsoft.z3.jar to Classpath, located at the Plugin.xml Runtime tab. In this case, the plugin is not finding the handler that is invoked after button press command.
!MESSAGE plugintest.handlers.SampleHandler cannot be found by
PluginTest_1.0.0.qualifier !STACK 0 java.lang.ClassNotFoundException:
plugintest.handlers.SampleHandler cannot be found by ....more
In fact, this approach worked for me a previous a installation (Dell, Intel, x64, Eclipse Mars (x64), Java 1.8 x64)!
Following the discussion in https://github.com/Z3Prover/z3/issues/1093, I configured Native Library Location of com.microsoft.z3.jar with the Z3 Build directory. Calling the Z3 Build from Eclipse plugin, the error reported is the same as in Approach 2, but calling it from a Java application, the error is more specific:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
C:\Users...TestZ33\build\libz3java.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at com.microsoft.z3.Native.(Native.java:14)
at com.microsoft.z3.Global.ToggleWarningMessages(Global.java:87)
at TestZ3.main(TestZ3.java:9)
Other https://www.chilkatsoft.com/java-loadlibrary-windows.asp
What is working is when you have a Java application under the Z3 build directory. Can anyone help how to use the Z3 build directory from a Java application, or from Eclipse plugin. By the way, I followed approach #2, was working fine until I try to replicate it (because my laptop crashed) and forced to use another laptop, then the same procedure is not working for me (I had luck, before). Right now, the new laptop has the following settings:
HP Laptop (AMD, x64)
C:\Users\nmd02\git\resa_mars_workspace>java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
PATH:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\QuickTime\QTSystem\;C:\Program
Files\MATLAB\2017a\runtime\win64;C:\Program
Files\Java\jdk1.8.0_144\bin;C:\Program Files\Git\cmd;C:\Program
Files\CMake\bin;C:\MinGW\bin;C:\python36;C:\Users...git\ninja;C:\Program
Files (x86)\Windows Kits\8.1\Windows Performance
Toolkit\;C:\gnuwin32\bin
I really appreciate for your help in advance.
Cheers,
/Nas
At runtime your code needs to find com.microsoft.z3.jar, libz3.dll/.so/.dylib, and libz3java.dll/.so/.dylib. Java takes care of the first one, but the operating system will have to find the other libraries, i.e., whatever environment your code runs in must be set up such that PATH (Windows), LD_LIBRARY_PATH (Linux), or DYLD_LIBRARY_PATH (OSX) point to the libraries. Also, make sure that your version of Z3 and your version of Java are both 32-bit or 64-bit, otherwise the error messages you get may not be very informative.
For some flavors of Java, it may also be necessary or helpful to provide the java.library.path setting to the JVM.

Cannot run Mule project from within Anypoint Studio; ResourceException

Problem:
When I want to run a project from within Anypoint Studio I am encountering a problem. This project was originally setup in Eclipse Juno with the Mule IDE plugin.
From within Eclipse Juno I was able to run the mule-config.xml on a local installation Mule Server.
Now I have upgraded to the latest Anypoint Studio (5.3.1; I have both the standalone and the plug-in with Eclipse Mars). I was successful in importing the project in the Anypoint environment and building it with Maven.
In both (standalone and plug-in) I am not able to run the project. When I try running through ‘Run Configurations’ I get an error where it complains that a resource is not available. But I don’t understand this error, because the resource /XmlProxyValidationFilter it is complaining about is a custom filter within my project in src/main/java which is on my build path (all included, none excluded).
Definition of the custom filter:
<custom-filter name="xmlValidatieRequestFilter" class="nl.xxx.icc.mule.XmlProxyValidationFilter">
<spring:property name="xsdRepositoryBean" ref="iccXsdRepositoryBean" />
</custom-filter>
Calling the custom filter from a flow:
<flow name="xmlproxy.validator">
<!-- some other stuff -->
<filter ref="xmlValidatieRequestFilter" />
</flow>
This flow validates an XML-message that is passing through against its corresponding XSD which is in the xsdRepositoryBean.
What I have tried:
In Run-configurations I have chosen my project in Mule domains/projects (expecting it to be added to the classpath) and Mule Server 3.4.0 CE as Target Server Runtime (same runtime as with successful Maven-build).
In Run-configurations tried to add the missing resource to User Entries on the Classpath tab.
I have found a suggestion to try in this question, but I am not sure how to do this since I use Maven integrated in Eclipse. Therefor I have tried converting my project to a Maven project (I think this is a function specific to the Anypoint plug-in) but this does not solve the problem.
Tried to find similar problems for possible solutions, but only the above came close.
Question:
Any ideas why I am getting an error about a missing resource when I try to run the flow, while this resource is in my project-folder and I can build the project without problems with Maven?
Error-log:
eclipse.buildId=4.5.1.M20150904-0015
java.version=1.8.0_31
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
org.mule.tooling.core
Error
Wed Oct 21 08:00:33 CEST 2015
Unable to package application ZIP file
java.lang.reflect.InvocationTargetException
at org.mule.tooling.core.packageManager.ExportPackageManager.export(ExportPackageManager.java:87)
at org.mule.tooling.runtime.launch.DefaultDeploymentStrategy.packageZipFile(DefaultDeploymentStrategy.java:55)
at org.mule.tooling.runtime.launch.DefaultDeploymentStrategy.deployToEmbeddedInstance(DefaultDeploymentStrategy.java:26)
at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.deployProjects(MuleRuntimeLaunchDelegate.java:486)
at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.performLegacyDeployment(MuleRuntimeLaunchDelegate.java:344)
at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.launch(MuleRuntimeLaunchDelegate.java:238)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/XmlProxyValidationFilter' does not exist.
at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:334)
at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:208)
at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:140)
at org.eclipse.core.internal.resources.Project.hasNature(Project.java:521)
at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyArtifacts(MuleApplicationDeployment.java:621)
at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyReferencedProjectsArtifactsRecursively(MuleApplicationDeployment.java:615)
at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyReferencedProjectsArtifacts(MuleApplicationDeployment.java:608)
at org.mule.tooling.core.packageManager.MuleApplicationExportDelegate.export(MuleApplicationExportDelegate.java:41)
at org.mule.tooling.core.packageManager.ExportPackageManager.doExport(ExportPackageManager.java:93)
at org.mule.tooling.core.packageManager.ExportPackageManager.export(ExportPackageManager.java:85)
... 10 more
Root exception:
org.eclipse.core.internal.resources.ResourceException: Resource '/XmlProxyValidationFilter' does not exist.
at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:334)
at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:208)
at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:140)
at org.eclipse.core.internal.resources.Project.hasNature(Project.java:521)
at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyArtifacts(MuleApplicationDeployment.java:621)
at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyReferencedProjectsArtifactsRecursively(MuleApplicationDeployment.java:615)
at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyReferencedProjectsArtifacts(MuleApplicationDeployment.java:608)
at org.mule.tooling.core.packageManager.MuleApplicationExportDelegate.export(MuleApplicationExportDelegate.java:41)
at org.mule.tooling.core.packageManager.ExportPackageManager.doExport(ExportPackageManager.java:93)
at org.mule.tooling.core.packageManager.ExportPackageManager.export(ExportPackageManager.java:85)
at org.mule.tooling.runtime.launch.DefaultDeploymentStrategy.packageZipFile(DefaultDeploymentStrategy.java:55)
at org.mule.tooling.runtime.launch.DefaultDeploymentStrategy.deployToEmbeddedInstance(DefaultDeploymentStrategy.java:26)
at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.deployProjects(MuleRuntimeLaunchDelegate.java:486)
at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.performLegacyDeployment(MuleRuntimeLaunchDelegate.java:344)
at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.launch(MuleRuntimeLaunchDelegate.java:238)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
#Jeroen Akershoek ... I have faced same issue. So please put your resource in src/main/resource directory and use class path loader in your filter jar.

IntelliJ debugger doesn't recognize Java version upgrade

I upgraded to Java 8 from Java 6.
As per these instructions, in /Applications/IntelliJ IDEA 13 CE.app/Contents/Info.plist I changed
<key>JVMVersion</key>
<string>1.6*</string>
to
<key>JVMVersion</key>
<string>1.8*</string>
My environment variable JAVA_HOME is set to:
/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home
However, when I run the debugger in IntelliJ, it still wants to use Java 6:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java ...
Connected to the target VM, address: '127.0.0.1:60490', transport: 'socket'
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/my/MainClass : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
What other settings do I need to change in order for IntelliJ to use the Java 8 JRE?
You changed the IDE's setting. Project setting can be changed here: File->ProjectStructure->Project SDK

(java)Could not find the main class

My code is compiled on OSX and it works fine(compiler version 1.6). But when I copy it to a remote ubuntu. I can not run it.
When I run
java TPCC.class
I got exception like this.(By the way TPCC.class is in default package)
Exception in thread "main" java.lang.NoClassDefFoundError: TPCC/class
Caused by: java.lang.ClassNotFoundException: TPCC.class
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: TPCC.class. Program will exit.
And my java version on ubuntu:
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode, sharing)
It's also 1.6 and I think it fits the compiled binary. How can I fix this problem?
The problem is in the way you run the program. Compiled java called
ClassName.java
will be ClassName.class. You should run it like
"java ClassName"
. You shouldn't run it as
"java ClassName.class"
What happens here is this. When you run it as java ClassName.class, JVM try to look for ClassName called "class" in the package called "ClassName" that does not exist. So it will throw NoClassDefFoundError.
This is an invocation problem as the error shows: java should be used and not the filename of the class.
The error message tries to say you this by stating that "TPCC/class" is not found.
(sorry for first adding comment, used the wrong field)
Specify the classpath when invoking java:
java -cp <path-to-jar> TPCC