Questions tagged [eclipse-jdt]

Use this tag for questions about the Eclipse JDT (Java Development Toolkit) project which provides the plug-ins that implement a Java IDE supporting the development of any Java application, including Eclipse plug-ins.

The JDT project provides the tool plug-ins that implement a Java IDE supporting the development of any Java application, including Eclipse plug-ins.
It adds a Java project nature and Java perspective to the Eclipse Workbench as well as a number of views, editors, wizards, builders, and code merging and refactoring tools. The JDT project allows Eclipse to be a development environment for itself.

852 questions
9
votes
5 answers

A better way of code generator in Java?

I have a class with a graph inside. I iterate the graph and create a string that builds the graph, and then I just write that string into a Java file. Is there a better way of doing this, i read about JDT and CodeModel but I really am needing some…
sm13294
  • 563
  • 7
  • 23
8
votes
2 answers

Java: how to detect the current java runtime is a JRE or JDK?

I got a Java application, I want to provide user ability to compile Java source code (Using JavaCompiler interface) If the user run the application on a JRE, my application should tell user that the no JavaCompiler instance aviable. so how to…
CaiNiaoCoder
  • 3,269
  • 9
  • 52
  • 82
8
votes
3 answers

Java refactoring tools

Possible Duplicate: A tool like ReSharper, but for Java? I make very heavy use of the Java code refactoring tools provided by Eclipse (extract interface, rename method, etc.). Does anyone knows of other similar tools (preferably Eclipse plugins)…
Dónal
  • 185,044
  • 174
  • 569
  • 824
8
votes
1 answer

Cannot cast eclipse project to IJavaProject

I have the following code IJavaProject targetProject = null; IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); for (IProject project : root.getProjects()) { if (project.getName().equals(projName)) { try…
Joeblackdev
  • 7,217
  • 24
  • 69
  • 106
8
votes
5 answers

Deprecate class inheritance only

I would like to deprecate only the extension of a given class, not all the methods and fields contained within a class, using the @Deprecated annotation. That is, a warning will occur if you extend a given class - but references to methods or fields…
BeeOnRope
  • 60,350
  • 16
  • 207
  • 386
8
votes
1 answer

Is it possible to run the Eclipse JDT compiler from the command line, like javac?

I'd like to do some command-line Java compiling of individual Java source files on a machine that has Eclipse installed. However, I don't have permissions to install a full Java SDK on this machine. I understand that Eclipse compiles through its…
system PAUSE
  • 37,082
  • 20
  • 62
  • 59
8
votes
1 answer

Generics and lambdas - different behavior in javac and Eclipse compiler

Note: I found multiple questions pointing out differences between javac and the Eclipse compiler, but as far as I could see all of them discuss other issues. Suppose we have this method: public static void foo(Supplier a, Function b,…
siegi
  • 5,646
  • 2
  • 30
  • 42
8
votes
0 answers

Content Assist not working inside Lambda Expressions

I'm running Mars 4.5.1. Content Assist isn't working at all inside the code blocks of lamba expressions. obj.doSomething(param1 -> { // Content Assist doesn't work here } Anything outside of the code block auto completes fine. Ex: param1 would…
pushit real
  • 501
  • 1
  • 6
  • 12
8
votes
1 answer

change the content of debug view in eclipse

I'm writing a java framework, for a class file, sample.class, it generates a proxy file sample_proxy.class. When sample.testMethod() is called, it excutes sample_proxy.class. I already make an eclipse plugin to make the breakpoint work, If I start…
nzomkxia
  • 1,219
  • 4
  • 16
  • 35
8
votes
1 answer

How to programmatically use Intellij IDEA code formatter?

I use Eclipse jdt to format my generated java files as below : public String format(String code) throws MalformedTreeException, BadLocationException { Map options = new java.util.HashMap(); options.put(JavaCore.COMPILER_SOURCE,…
Pooya
  • 4,385
  • 6
  • 45
  • 73
8
votes
5 answers

org.osgi.framework.BundleException: Could not resolve module

I'm trying to setup my eclipse plugin development target and receive the following error multiple times: !ENTRY org.eclipse.e4.ui.css.swt 4 0 2015-01-30 15:15:06.879 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could…
Dreiven
  • 687
  • 3
  • 9
  • 22
8
votes
1 answer

Calling organize imports programmatically

I'm trying to execute 'OrganizeImports' programmatically on files that I'm editing programmatically. My code looks like this: final ICommandService cmdService = (ICommandService)PlatformUI.getWorkbench().getService (ICommandService.class); …
8
votes
2 answers

Simplifying fully qualified names in Eclipse

Does someone know a plugin for Eclipse that replaces fully qualified Java class names with the simple one and the corresponding import where possible? It would be even better if it could be performed as a Save Action.
thSoft
  • 21,755
  • 5
  • 88
  • 103
8
votes
1 answer

How to disable Eclipse's "auto-folding during typing"?

Eclipse (any version AFAIK) has some weird behavior related to folding in Java code. Suppose I’m editing this class: class A { String field; @Nonnull Object method(){ // whatever } } If folding is enabled and I tell it to collapse…
bogdanb
  • 448
  • 3
  • 10
8
votes
1 answer

why does m2e plugin for eclipse insert optional attribute to src and what does it do

I started noticing these attributes in my .classpath file after running Maven -> Update Project... tool with Update project configuration from pom.xml option checked:
Roland Tepp
  • 8,301
  • 11
  • 55
  • 73