Enable IndentGuide Eclipse plugin in java files - java

To install indentation in Eclipse I dropped this IndentGuide jar in the dropins folder (I couldn't install it in the "Install Software..." option as it's not available any longer).
I restarted Eclipse and I see the IndentGuide customization screen, but java does not show in available content types:
The indentation works fine in text extensions, but does not work for java. I looked at the eclipse/configuration folder but couldn't find anything. Any ideas?
UPDATE
This is what I see under Text > Java:

Update preferences to make it work with Java files

Related

Exception occurred while getting the javadoc: Unknown javadoc format

I'm working on a spigot plugin for Minecraft in Eclipse and the javadoc for spigot suddenly stopped working. If I hover over a spigot method I get the error mentioned in the title. Java internal methods display the javadoc just fine, and so do any methods in my classes that I've added javadoc for. The spigot javadoc location is set to https://hub.spigotmc.org/javadocs/bukkit/, which is loading fine, and validates just fine.
After doing a little research I found this issue is usually caused by unbound or non-JDK references in Windows -> Preferences -> Java -> Installed JREs. I removed all java JDKs and JREs on my system, installed the latest JDK 8u77, and added it in installed JREs. It is the only one listed and it is ticked. The path is C:\Program Files\Java\jdk1.8.0_77, which is my only JDK installation. I even tried installing the latest version of Eclipse Mars 2 to a different folder, and running clean on my workspace. Not sure what to try next.
Using the offline docs worked! Go to The Maven repository for Spigot.
In the bottom section that says snapshots, click the + next to "org", then "bukkit", then "bukkit" again. Then click the + next to the version of Bukkit you are using. The first file listed should end in "-javadoc.jar". Right-click this file and hit download. Save it to the resources folder of your project. Then edit the javadoc location of the bukkit jar in your build path, and set it to "Javadoc in archive". Browse to the file you just downloaded, select it, and save. Working 100% for me now!
The spigot javadocs are in that same Maven repository, so if you're using spigot just open the spigotmc folder instead of bukkit.
Not really an answer, but using IntelliJ should solve the issue. As for why Eclipse can't handle this, I really don't know. It happens to me too, and not only: https://bukkit.org/threads/unknown-javadoc-format-eclipse.414506/ However, other libs seem to work.

Trying to run decompiler in Eclipse Luna

I am trying to debug a jar file I don't have source for, in Eclipse Luna
I have tried various decompilers, and can't get things to run.
The most recent seems to be JDEclipse-Realign at http://mchr3k.github.io/jdeclipse-realign/
It installs without any trouble. I have set set the default file association for "class without source" to be "Class File Editor" like this
I added the jar file to be debugged as an external jar to my project. And when I expand that and right click on a .class file I get what is shown on the web page for JDEclipse-Realign, with Decompiled Source as the default.
And I am getting the blue and white icons for JDEclipse-Realign when I select a class file.
But no decompiled source :( And clicking the blue icon for Attach Decompiled Source does nothing.
I feel like I must be missing one basic thing, but can't figure it out. No errors, just no source.
Or should I be using a different decompiler?
Are any known to work in Luna?
Faced the same problem on Luna and did the following:-
Open Eclipse Luna
Go to HELP -> Eclipse Marketplace
In the find box, type "jad". [stands for Java Decompiler]
You will get a single result titles something as "JadClipse for Eclipse ".
Click on Install and restart eclipse when prompted. Your issue will be fixed.

R.java never appears

When I work on an android application in Eclipse, R.java never appears. I did the following to try to fix it:
delete ~/.eclipse folder
reinstall eclipse
create a new workspace
reinstall android developer tools
reinstall operating system
None of it worked. Even the Hello World! application that is created by default won't build. What do I have left I can do?
UPDATE:
There aren't any problems in Problems other than the two "R cannot be resolved to a variable"s. The Error Log tab shows an error Failed to load properties file for project from when I created the project. I think that may be a good clue as to what the root issue is.
ANOTHER UPDATE:
It's not a permissions issue, since the same thing happens when I run Eclipse as root. 'Fix Project Properties' does nothing. When I comment out the references to R.java, the problem is not resolved (the reason it doesn't run is [2013-07-08 21:47:37 - AppName] Could not find AppName.apk!
)
YET ANOTHER UPDATE:
running eclipse as root works now.
OS is 64-bit Arch Linux
Make sure that you have no xml related error( open and check all xml files, including the manifest manually).
Clean your project.
Change the build target version.
Make sure that you have Android SDK build tools. It comes on updating the ADT plugin.
Try these things:
Check in the properties of the project, in the Android tab if you have downloaded the version of the API that you are using. (See this in the SDK Manager)
Look into your /res folder. Scan for every file. Does any one has problems? If one resource has a problem, the R.java file is not generated.
Check the AndroidManifest.xml file. Look for warnings or problems, especially the use of the <uses-sdk> tag.
If none of these appointed the problem, try to build a simple java application. Does it work? Are you using the JDK 1.6?
Finally, if you are still stuck, download the Android ADT and use it as your IDE. It has all you need.
If your O/S is 64-bit Linux you will encounter Problems with the ADT because it is a 32-bit application. You have to install the following 32-bit libraries:
sudo apt-get install ia32-libs

Eclipse does not work with JSP

I'm following this tutorial about using Google engine API to create web application.
When I add any file with .jsp suffix into my war folder the project will not compile any more.
What can be the reason ? If you need more information please just leave some comment. Thank you.
Can it be that I it cannot compile because I did not download "Eclipse for Java EE developers" but only "Eclipse for Java developers" ?
I'm not sure. I see <Java EE> in the title bar in your Eclipse screenshot which is typical for Eclipse for Java EE developers. So you have likely the right version. If you are able to do File > New > Dynamic Web Project then you definitely have the Java EE version or at least the one with WTP. More detail can be found in Help > About Eclipse.
the error in Markers tab is "Your project must be configured to use a JDK in order to use JSPs"
You need to install the JDK. Go to the Java SE download home page and click the leftmost one of the four big buttons. Done that, go in Eclipse to Windows > Preferences > Java > Installed JREs, select the existing JRE, click Edit and let the JRE home path point to the JDK folder.
It it asking you if you want to run even though it found errors in the project. First, what are the errors and can you fix them easily? Eclipse gives pretty good error messages. If the errors are from validation, turn them off in the project settings, then try running the project again.
Otherwise, double check that you are using the exact code from the tutorial. Copy the code from Google and save it into a separate file. Then select your file, and the new file, right-click on the two files and use Eclipe's file-compare to show you if you missed anything.
[edit]
You could install the EE version to a different directory. Different versions of Eclipse do play nice with each other, they're just huge. Do not import your project into the EE workspace. It will come across as a plain Java project and you need a Web project. Create a new Web/JSP project and then copy the files over.

EGit opening .java files as plain text

So I've finally figured out how to use Git. (thanks to all the users here :)) And so I installed EGit on Eclipse. But now I have yet another problem:
So EGit works awesomely in Eclipse, and I can push/pull/commit/whatever else, but there's an annoyance: The whole reason I used EGit was so that I could edit the Java source code of a repository. But whenever I try to open a .java file from the repo, it just shows it like a text document. I've tried clicking "Java Perspective" but that just made the screen larger.
Is there any way to directly edit/save Java source files inside of Eclipse's Java editor if the source files come from EGit?
If you're editing files in Eclipse that are java files but are handled as text files instead this could mean that the project's nature or facet settings are not set to be Java.
To avoid the natures/facets mess in eclipse you can "clone" the repository into eclipse. You do this through the import dialog. Here are some instructions on how:
http://www.vogella.de/articles/EGit/article.html

Categories