Issues with Eclipse while working on and Android project - java

I am currently developing an application with my software engineering classmates. I am experiencing a few issues with Eclipse, however. But first, some information about my Eclipse: I am running version: Juno Service Release 2 with a build id of 20130225-0426. I am running Eclipse on my MacBook with OS X Mountain Lion 10.7.5. I am using SVN to upload and download the project to a repository through assembla.com.
First, Eclipse will not recognize any errors. If I purposely type random characters, Eclipse does not underline them with red.
Next, whenever I type "this.whatever" or "# for javadoc" I receive the following message: "this compilation unit is not on the build path of a Java project." I can click "OK" and continue with no problem though.
Finally, whenever I attempt to run the program I receive this message:"The selection cannot be launched, and there are no recent launches."
Other notes: I do not have any of these issues with any of my other projects in my workspace. I also have another project using the assembla repository that does not contain these issues. These issues just occurred all of the sudden.
Edit: None of the other members in my group are experiencing these issues. I have attempted to download the project from the repository on a different machine and I still have these problems. I have attempted to delete the project from my workspace and re-download. Still a no go.
Update: I even installed the Android Development Kit and used the included copy of Eclipse. It will still not work properly.
What is going on with my Eclipse?

Since I guess you're in start phase of android coding and you're not addicted to a special IDE, I strongly recommend the IntelliJ IDEA instead of Eclipse for Android development. I have tried Eclipse already and because of its weaknesses, now I'm using IntelliJ. Eclipse is not the best IDE for Android development and have a long way to become the one.
IntelliJ IDEA

I suggest you try installing the ADT bundle in a new location and see if you still have these problems. The ADT bundle includes the latest Android SDK along with a version of Eclipse with the ADT (the Android Developer Tools plugin) already installed and configured. It's possible that you have (or have had in the past) other Eclipse plugins that affect how the Java tools in Eclipse work, possibly in a way that interferes with ADT. I have personally had problems like this in the past with tools like Aptana, where even after uninstalling there would be problems.

Eclipse is telling you already with the above error message: You don't have your sources on a build path, but just in some folder.
Either you have created a simple project instead of a Java project, which then also doesn't do anything Java specific. Or you have created your Java files in plain folders, instead of source folders.
The best way to sort this out is to create a new Java project using the Eclipse "New..." wizard from the main menu. Compare the result of that to your project. The two important things are: The project has an icon with a small "J" overlayed. The Java sources are shown in packages, which themself are in source folders (with a package overlay), not in simple folders.

Related

JRE System Library is always unbound in Eclipse? (An internal error occurred during: "Launching Main". Model not available for helloWorld)

THE PROBLEM
I've been developing in Java for years, but a recent install of my tools on a new computer (Windows 10) has resulted in the strangest problem. When I create a new project, almost everything is underlined in red. The error reads Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor:
WHAT I TRIED:
A quick search online reveals that I should JRE System Library is most likely unbound, so I change it: Properties >> Java Build Path >> JRE System Library >> Edit:
All of the red lines go away, but I can't run my program. An Error reads:
An internal error occurred during: "Launching Main".
Model not available for helloWorld
On closer inspection, Eclipse shows an error in the src/test folder, but there are no files there.
When I restart Eclipse, all of the red lines reappear and I have to do everything all over again. It also cannot find the JUnit dependencies either, and I have to manually add JUnit 4 library to the build path.
DEETS YO:
OS Details:
Windows 10
Eclipse Details:
Version: 2019-09 R (4.13.0)
Java Details:
Java 13.0.1
Alright, so none of the posted suggestions worked but I independently found out what was wrong. In general, I've found that this solves a lot of weird Gradle activity, including the ominous "Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-5.6-all.zip'" that a lot of people have problems with once they try to use Gradle with new versions of Eclipse.
Solution
When you install Eclipse, there's a Buildship Gradle Integration plug-in that is visible in the Eclipse Marketplace (it has a little graphic of an elephant next to it). When you get modern versions of JavaEE Eclipse, it comes with that installed.
The problem is that this isn't the most updated version of it.
So you have to click the button that reads "installed" and it'll update it. After you update it and restart Eclipse, your most recent version of Gradle will work.
When using gradle run this:
gradlew cleanEclipse eclipse
this will re-generate the eclipse project and this helped me
Under a fresh Eclipse, we encountered this "Model not available problem" on projects that do not use Gradle, but maven.
To update gradle did not change anything. We assume that there is a conflict between m2e and this plugin. We found 2 solutions :
A) Add gradle nature (even if unused)
Right-click on the project
Configure
Add Nature (elephant logo)
Run your app, enjoy
B) Uninstall gradle. (if not used and not mandatory for your eclipse version)
Help/Eclipse MarketPlace
Search "Gradle"
Go to "BuildShop Gradle Integration 3.0" (the elephant) which is indicated as installed and clic on the grayed installed button.
Uninstall it. It will restart eclipse.
Run your app, enjoy :)
In my case it is resolved by updating Buildship Gradle Integration 3.0 from Eclipse market place

Throwing a warning message to install few uninstalled plugins on Eclipse launch after I updated with Groovy library

I came across a Maven project which has Groovy files in it. Those Groovy files were not getting recognized during initial compilation. So, I added groovy libraries in build path.
Due to that, when autobuild is triggered it shows the following error window:
Also, I am not able to decompile the dependent jars and all the projects went into error state.
I tried restarting my eclipse and it asked me to install the following plugins:
When I click on install, it prompts me the following error window:
I am not sure if reverting back all my changes of adding Groovy libraries is a good idea! Any leads on handling this situation will be appreciated.
It sounds like you added the Groovy Development Tools to eclipse. GDT patches the Java Development Tools (and provides LanguageSupportFactory class mentioned above). If you use the incorrect version of GDT to patch JDT, eclipse can end up in a very bad state.
I recommend looking at Help > About Eclipse Platform > Installation Details > Installation History. You can revert to a previous state where GDT was not installed. If you want to add back GDT, be sure you use the update site that matches the version of eclipse you are using.

How to convert a specific android project built with ant to gradle?

I am using this framework for one of my projects and i have problems keeping it up to date. It is a little old, uses ant to build the components and is meant for eclipse. I usually use android studio and use gradle to build from interface(not command line).
The project has a host and plugins that are loaded from a server. The plugins are compiled from the command line cmd from windows using "tools/update.sh workspace" and "ant release" commands.
What i succeded so far:
I manually copyed the files from the host component and succeded without too much stroogle to do an android studio project and build it with no errors. And it succesfully loading the plugins.
On the plugin side I have to projects: for every new plugin i do a special android studio project and after everything is ok I adapt the code and copy it to a special template like eclipse project(i edit it with notepad++ no need for eclipse) and i build it with "ant release". That apk then i move it to server.
You see now that it is a little strange but somehow I made it to work. Problem is I'm always on the edge, I almost make it every time with little hacks to pass the build process. I think it is because i work in a mixed situation. I want to port everything on android studio and gradle. And hopefully build everything from the android studio command line.
The host builds in a jar file and is used in the plugin build.
I will put the new source code on request, till then you can see it in action here
To be more specific, the impassable bug appeared when i used MediaPlayer on the plugin. I had to move the wav files on the host witch is opposed to the framework design. But this is anyway the tip of the iceberg. So i would like to port everything from ant to gradle, and eclipse to android studio.
Thanks for your help.
If you have any existing project open in your Android Studio then just close that project. After your project is closed, it will show you a Welcome screen popup, there you can select Import Project option and it will automatically convert your project into Android Studio Project.
Here is what it will look like

Setup Play 2.2.1 and IntelliJ 12.0.4

I am running on OSX 10.9. I have downloaded Play 2.2.1 and want to use IntelliJ 12.0.4. for development.
I set it up by running play in the directory of the project followed by idea with-sources=yes followed by a compile.
I can run the project from the terminal and from IntelliJ without any problems. All the changes I make to the files are reflected in the browser when the project is recompiled.
What troubles me is that IntelliJ cannot resolve the views which makes its auto-complete function useless. The error is "Cannot resolve method ok(?)/Cannot resolve symbol index".
I have read a great deal of material on the matter but to no avail. I would be grateful if anyone points out a step I am missing.
I have had this problem on occasion; unfortunately I can't reproduce it now with any of my Play 2.2 projects, but I remember having to do this to get the views to resolve:
Go to the Module Settings for your project in IntelliJ (select the top-level, hit F4)
Choose the Modules item in the Project Structure window that appears
Select the <projectname> item (as opposed to the <projectname>-build) item
Add the compiler's output views directory to the Source Folders items;
I'm in Scala so for me it's target/scala-2.10/classes/views
I'm sure it'll be something fairly similar in Java - probably target/classes/views?
I personally find the IntelliJ UI for this to be very non-intuitive; you might need to take the target directory and/or one of its subdirectories out of the Excluded Folders first
After applying that change, IntelliJ should see those view files as just-another source file, so auto-complete should work for them.
Also it might be that the Intellij you are using is not the Ultimate Edition.
The community edition does not support Play Framework versions lower than 2.4.x
look for 'play' here: https://www.jetbrains.com/idea/features/editions_comparison_matrix.html

Unable to run Java program in Eclipse Juno 4.2

I reinstall my Eclipse environment every year when the new version is released. The most recent release - Juno - however, does not work as expected.
Currently, when I try running demos from Oracle, for example, it asks me to select an Ant file to run before compiling. After creating a blank Ant file to bypass the requirement (which I thought was rather dumb, since I don't think TDD is something that should be forced on people), it still refused to run, saying the "Selection could not be launched."
I understand that Juno is an update from the 3.x track to the 4.x track, but this seems a little ridiculous to me. What can or should I do so I can get Eclipse back up and running again?
Just to clarify:
All files in question are on my Eclipse workspace path
I don't do much in the way of Java development, though I know I'll need to do so soon. Hence, my unfamiliarity with the most recent version of Eclipse.
I would like to run my files & projects without Ant files. I know it has something to do with Run configs, but I don't know how to change them.
Here's what I did to run the demo from Eclipse Juno:
Downloaded the project from http://docs.oracle.com/javase/tutorial/uiswing/examples/zipfiles/components-FrameDemoProject.zip (if this is not the correct demo, then please provide the link you're using)
Unzipped it to my projects directory (not my workspace), so that you have:
PROJECTS_DIR/components-FrameDemoProject/src
PROJECTS_DIR/components-FrameDemoProject/nbproject
PROJECTS_DIR/components-FrameDemoProject/build.xml
From Eclipse, File > New > Java Project
List item Uncheck Use default location and navigate to <PROJECTS_DIR>/components-FrameDemoProject
Hit Finish
Drill down to src/components/FrameDemo.java
Right-click on FrameDemo.java and select Run As > Java Application
Let me know if any of these steps give you trouble.
Take a look at you project properties and select the Builders entry. Do you see an Ant Builder entry? Try to select or create a Java Builder entry instead.
I just created a new Java Project in Juno and added the FrameDemo.java source. In my case, the Java Builder was selected as the default for this new project.

Categories