Eclipse doesn't show java source code - eclipse

I'm running java 1.6 in Eclipse on my Intel Mac. I'm using the 1.6.0 version under System/Library/Frameworks and set the default compiler to this in Eclipse.
How do I attach the source code?
First, I downloaded the 1.6 source from oracle, thinking I could attach that 'cause the installed 1.6 didn't have source.
When I click a java class to get the Source Code Editor, there are problems:
first, the top line says Compiled from File.java (version 1.5 : 49.0, super bit)
most important, when I attach the 1.6 source jar file, it gets an error:
An error has occurred. See error log for more details.
Unable to create resource org.eclipse.ui.internal.misc.ExternalProgramImageDescriptor#50417ba8
This also appears in the error log:
java.lang.ClassNotFoundException: org.eclipse.ui.internal.views.log.LogView
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
The Eclipse version is: Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 2
Build id: 20110218-0911
When I click for installation details, I get:
An internal error occurred during: "Fetching children of _SELF_".
Registry Directory not available: /Users/rfrail/Downloads/eclipse 2/p2/org.eclipse.equinox.p2.engine/profileRegistry.
I'm running Eclipse from my Download directory (it's worked fine in the past); however, there are 2 folders for Eclipse:
eclipse, and
eclipse 2.
So that looks like a source of confusion right there. Eclipse operates fine otherwise.
Can you help, please?

http://java.decompiler.free.fr/ is your answer
it has an eclipse plugin which decompiles code in place

Related

export with jdk 8 still got error when start server

I used eclipse with jdk 8 to export to jar. Yet i still get this error when start my server sfs
Exception in thread "main" java.lang.UnsupportedClassVersionError: sfs2x/extension/mmo/MMORoomDemoExtension$NPCData has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Could someone tell me how to fix.
I tried to uninstalled all java and install jdk8 only. But nothing change.
I had a similar problem, what fixed it for me was making sure that jdk8 was selected as the build jdk for that project (right click on your project in Eclipse and click on properties -> Java build path -> JRE System Libraries -> Workspace Default JRE, make ure that jdk8 is selected) and then recompiling. I was able to delete all .class files before recompiling as well, but that may be difficult if this is a project.
Best of luck.

Error running simple program in NetBeans 9.0

I'm trying to use NetBeans for a JDBC project. However, I'm getting runtime errors when I try to compile. I decided to try a "hello world" project and I couldn't get that to run also. I'm in NetBeans 9.0 with Java JDK 10.0.2.
Error Message:
Exception in thread "main" java.lang.RuntimeException:
at javaapplication2.JavaApplication2.main(JavaApplication2.java:1)
C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 1 second)
xml debug:<call-java classname="#{classname}" classpath="#{classpath}" modulename="#{modulename}" modulepath="#{modulepath}">
package javaapplication2;
public class JavaApplication2 {
public static void main(String[] args) {
System.out.println("Hello");
}
}
It is very easy, your JDK version is not 100 % compatible; use version 8.2, which is the most stable for Arduino and others.
To change platforms without deleting the existing one, simply go to Tools / Java Platforms / click on the button add Platforms.
Download/install JDK major version number the same as NetBeans.
i.e. If You have NetBeans 9 version, but your JDK is version 10,So try use NetBeans 10 version... or download/install JDK 9 (the same as NetBeans).
Create new java platform for new jdk installation.
Open netbeans menubar->tools->Java Platforms->Add Platform Specify the folder that contains the Java platform as well as the sources and Javadoc needed for debugging.
Set new java platform to your project
Right click on project ->properties->Libraries->Java Platform->select the jdk version that same as NetBeans.
Select source format of your project
Right click on project ->properties->Sources->Sources/binary format->select the jdk version that same as NetBeans.
If it still give same error,Open the project properties, select the Build-Compiling, uncheck "Compile on save" and rerun the application. This will make sure all your source code becomes recompiled before running it.

org/eclipse/e4/ui/model/application/ui/MUIElement Class Not Found , Java Eclipse Juno

I am doing a CIMTool project, for a handle of WorkbenchWindow
Code Snippet
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
//(both these Classes are present in Libraries)
IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
Issues
Following Error is slapped
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/e4/ui/model/application/ui/MUIElement
at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:90)
Environment
Eclipse : Eclipse Java EE IDE for Web Developers, Version: Juno Service Release 2
OS : MS Windows 7 Professional, X86
Java Version : java version "1.7.0_25"
Questions
I tried searching for org/eclipse/e4/ui/model/*, I could not find in
Archives. Where I can find ?
Is there any otherway to get IWorkbenchWindow Instance ? (want to
avoid this issue)
This problem I found that, doesnt appear in Java Indigo. But my project has to be developed in Eclipse , so I cant migrate.
thanks
I also was confronted with this error when executing code from within a project that was created as "SWT/JFace Java Project" using Eclipse Kepler (displaying a ListSelectionDialog).
The main problem is that the project set-up misses a JAR file that contains the MUIElement class. You can easily fix the project set-up by editing the build-path, adding the external jar which has a name similar to this one:
org.eclipse.e4.ui.model.workbench_1.0.1.v20131118-1956.jar.
You find that jar in the plugins directory of your Eclipse installation.

Eclipse : Errors occurred during the build Groovy/Grail Project

I have installed GGTS plugin for eclipse kepler 3.5.1 RELEASE. I created simple grail project. But while building project. Its getting error
Errors occurred during the build.
Errors running builder 'Java Builder' on project 'FirstApp'.
org.codehaus.groovy.runtime.StringGroovyMethods.plus(Ljava/lang/String;Ljava/lang/CharSequence;)Ljava/lang/String;
and if we saw in markers, I found this error
Internal compiler error: java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.StringGroovyMethods.plus(Ljava/lang/String;Ljava/lang/CharSequence;)Ljava/lang/String; at
org.codehaus.groovy.grails.transaction.transform.TransactionalTransform.moveOriginalCodeToNewMethod(TransactionalTransform.groovy:259)
Config.groovy /FirstApp/grails-app/conf line 0 Java Problem
I am using feroda 17. Eclipse Kepler.
We were experiencing the same error today, it turned out that the project created by GGTS had a groovy compiler level of 2.3 but the GGTS plugin only supported up to groovy compiler level 2.1.
The fix was to install the "groovy 2.3 compiler for groovy-eclipse".
The compiler can be found under the "language and support tooling" heading in the extensions browser which is opened by clicking the "IDE extensions" button in the STS dashboard.
Although the compiler states that it will automatically become the default workspace compiler in eclipse this did not happen for us. In fact we needed to set it as the workspace default in "preferrences > groovy > compiler" and then restart eclipse (maybe I restarted twice, cant remember exactly).
we also ended up installing "groovy 2.3 compiler for groovy-eclipse" twice as the first time an eclipse IDE update was installed, I think because our kepler installation was a bit old.
Hope this helps.

Eclipse CDT failure to debug in Ubuntu 11.10, throwing java.lang.NullPointerException

I've recently done a fresh install of Ubuntu 11.10, installing the latest version of Eclipse CDT. I'm trying to debug an existing C++ project with makefiles and Eclipse project files generated by CMake. Upon attempting to debug (with all of the correct settings given in the Debug Configuration), the launch fails with error:
An internal error occurred during: "Launching mops-app".
java.lang.NullPointerException
This does not occur when trying to debug a minimal Hello World project. The project could be successfully debugged on Ubuntu 11.04 with the latest version of Eclipse CDT. The java version on my machine is:
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre10-0ubuntu5)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
And the Eclipse output from trying to launch the debug configuration is:
!ENTRY org.eclipse.core.jobs 4 2 2011-10-31 11:50:24.211
!MESSAGE An internal error occurred during: "Launching mops-app".
!STACK 0
java.lang.NullPointerException
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1837)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1848)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1848)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.setSourceLookupPath(CDebugTarget.java:1815)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initializeSourceLookupPath(CDebugTarget.java:383)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initialize(CDebugTarget.java:282)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.<init>(CDebugTarget.java:275)
at org.eclipse.cdt.debug.core.CDIDebugModel$1.run(CDIDebugModel.java:100)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)
at org.eclipse.cdt.debug.core.CDIDebugModel.newDebugTarget(CDIDebugModel.java:105)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchLocalDebugSession(LocalCDILaunchDelegate.java:162)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchDebugger(LocalCDILaunchDelegate.java:112)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launch(LocalCDILaunchDelegate.java:72)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
The issue was associated with upgrading the version of CMake. CMake 2.8.5 generated 'Subproject' entries in the Eclipse .cproject and .project files. For some reason, CMake by default told Eclipse to ignore the Subproject paths, thus confusing Eclipse's indexer when it tried to debug code.
The problem is easily resolved by commenting-out the <linkedResources> entry of the .project file, e.g.
<!--link>
<name>[Subprojects]/MOPS</name>
<type>2</type>
<location>/home/user/mops-c-Git/src/mopsc</location>
</link-->
and commenting-out the Subproject portion <pathentry> entry of the .cproject file, e.g.
<!--pathentry kind="src" path="MOPS"/>
<pathentry excluding="MOPS/|**/CMakeFiles/" kind="out" path=""/-->
Make sure to have selected the executable to run in the Run/Run or Run/Debug menu.
I had a similar problem (Ubuntu 14.04, SBT 13.1.0) - launching Debugger caused a java.lang.NullPointerException. Checking the log by starting Eclipse with eclipse-nios2 -consoleLog, I had similar entries:
java.lang.NullPointerException
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1843)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1864)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1864)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.setSourceLookupPath(CDebugTarget.java:1817)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initializeSourceLookupPath(CDebugTarget.java:385)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initialize(CDebugTarget.java:286)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.<init>(CDebugTarget.java:279)
I believe the cause is the same; I found another fix and wanted to share it for completeness.
I have linked resources in my project, and the log made me suspect they were the cause. I had linked the resources with Import->General->File system->[... Create links in workspace...].
I removed these links and instead linked to the sources by Project Properties->C/C++ General->Paths and Symbols->[tab] Source Location->Link folder....
This made the Debugger run fine without complaining.