Compiling in Eclipse/STS produces no output - eclipse

I'm a Visual Studio .NET developer who's trying to switch to Eclipse/SpringSource Tool Suite, so I get stuck on probably simple problems. Please bear with me.
I'm working on a Spring MVC project associated with an Apache Tomcat server. If I right-click the server and choose Start (alternatively Package Explorer->right-click project->Run As->Run on Server), my project is compiled and started. Compiler output is shown in Console window. Fine.
But if I simply want to compile the project without running it, I try selecting Project->Build All, Project->Build Project, or Project->Build Working Set. Nothing happens, no screen output, nothing -- despite having non-compiling code.
I expected to see the compiler errors on screen, preferably with the errors highlighted in the code. For what it's worth, I have deselected Project->Build Automatically. Anybody knows what I should do?

Eclipse and STS use incremental compilation. So, every time a file is saved, it is automatically compiled (as well as all files dependent on it). When you deselect Build Automatically, then yes, you will need to explicitly build, but this will still be an incremental build (ie- only the changed files and dependencies).
See here for a bit of a discussion on how incremental building works in Eclipse: http://www.eclipse.org/articles/Article-Builders/builders.html

Related

IntelliJ SBT project import problems

I'm almost sure that this must have been asked and answered, but I've failed to find an answer in a forest of "almost but not quite" related tissues.
Scenario. I have an SBT project cloned from Git, but it has only source and build.sbt. It builds fine from a command-line sbt, but has no IntelliJ specific project files.
I do "import project", and get to a point where IntelliJ mostly seems to recognize the project. However, several problems remain:
The project has no SDK. This is an easy fix, as the IDE prompts to add one, but I mention it, as it might have relevance to the other problems.
The project (after adding an SDK) will not run. It claims to build properly, but on running, it reports "Error: Could not find or load main class blah.Blah". Now, I intermittently get this on a brand new project, and the solution has always been to pop up the SBT console and build it from there. After that, the problem typically goes away. But...
In this project, there is no option for the SBT console. I can start one from the Terminal, but that's not the one that solves the problem in 2) above. Normally, SBT console is available to me on the bottom line, next to tabs like "Run" "Terminal" "Todo" and the like. But it's not there, and it's not on the View->Tool Windows list (not even greyed out). However, the "SBT" window is offered, but that only handles SBT structure, not actual operations.

Eclipse trouble when building project with GCC

I'm using Eclipse + gcc compiler for ARM Cortex-M3 processors.
After a successfull project build, if I modify a source file and I start build again, it builds the whole project again instead of the only modified file.
I noted the following:
- I go to another build configuration and I successfull build it;
- then I go back to previous configuration and it builds the modifiede file only;
But the problem persists: if I restart build it will recompile all even though nothing changed.
I hope I was clear.
Any suggestions?
Best regards,
Valter
Sorry, I didn't understand your question: what do you mean? I click on "build" hammer button. It seems that it started to happen when I simply changed build configuration name because, before this, it has been working properly for months. It seems that make procedure inside Eclipse doesn't recognize that file was already successfully compiled.
Thanks a lot.
Valter

Debugger source line synchronization not working in IntelliJ IDEA Scala plugin

I'm running IntelliJ IDEA 12.1.3 on Windows 8 with the Scala plugin 0.7.264. Scala is installed in C:\Apps\Scala\scala-2.10.1, and that directory is in my PATH. The Scala docs are in C:\Apps\Scala\scala-2.10.1\doc\scala-devel-docs\api. These are manual installs from the .zip files.
Everything seems to work fine except for two things:
First, if the "Run compile server (in external build mode)" settings is enabled (as it is by default), I get this error:
Turning off that setting fixes that for now, but there is another problem. I can run my code in the debugger and see values change in the debugger panel as I single step through the code, but it doesn't synchronize the source file view as I step through.
Normally I'd expect to see the current line being executed turn green, and the green highlight would follow along as I hit F10 or F11 to step through, but it doesn't. I can set breakpoints on source lines and let it run, and it stops at each breakpoint as expected. It just doesn't highlight the source line in green when it gets there.
Similarly, if a source file is not open (either my source code or a library file), and I step into that code, it appears to single-step correctly but does not open the source file at all.
Everything else works fine, like the autocompletes and Shift+F1 to view the Scala docs for the name the cursor is on.
The really odd thing is I had full debugging working briefly. At first I'd installed Scala from the .msi file, so it installed Scala into C:\Program Files (x86)\scala. When I set up IntelliJ to use that Scala installation I did get the green highlight on source lines as I stepped through the code.
The only problem with that setup was that IntelliJ complained about the missing doc\scala-devel-docs\api directory when I'd setup a Scala project, because the .msi installation uses a different subdirectory for the API docs. It was easy enough to fix that up manually in the Global Liraries settings, but I figured I'd try the .zip installation so I could use a directory layout more like what IntelliJ was expecting.
I should have left well enough alone! I even tried going back to that arrangement and still didn't get source line synchronization working again.
At one point I also tried letting IntelliJ do the Scala installation, but that also gave the same results: everything working except source line synchronization in the debugger.
There must be some obvious thing I got wrong, but I'm not sure what it could be. Does anyone have any ideas?
Here's a screenshot from a debug session:
The program is stopped on line 3, as indicated by the values assigned to x and y but not yet to z, and the <init>():3, Main$$anon$1 in the Frames panel. So line 3 should be highlighted in green but isn't.
Here are the relevant settings dialogs:
The above is with "Run compile server" on; as mentioned I ended up turning that setting off. The field values are the defaults, including the -server -Xss1m -XX:MaxPermSize=256m JVM parameters.
I am using the same version of IDEA and the Scala plugin (however on OS X and JDK 6), and I do not have this problem. Does this occur with any of your projects or only a specific one?
Assuming that the OS shouldn't be responsible, the difference is that I use sbt to build my projects. So if you are willing to set up a build.sbt and installing the SBT plugin for IDEA, this might be worth a try.
Although the fancy new compile server should in theory be as fast and smooth as sbt, I find it very pleasant to work with the sbt plugin. You can install it from Settings -> IDE Settings -> Plugins. Next step I also highly recommend is to use the sbt-idea plugin, which is like the complementary to the IDEA SBT plugin—this will allow you to generate the full IDEA project files from sbt (you can have as little as a single scalaVersion entry in build.sbt if you don't need to manage dependencies, so you don't need to learn much of sbt in the first place).
The final step then is to go into your Run/Debug configuration, and change in the "Before launch" section from "Make" to "SBT".
Finally you might get better support for your problem through the JetBrains online forum.

Play Framework + Eclipse: undefined method for ReverseApplication

I'm having a little trouble (more like an annoyance, really) when using the Play Framework with Eclipse.
I'm following this tutorial to get started with Play. In a certain moment in the tutorial, it asks us to type in this code:
public static Result index() {
return redirect(routes.Application.tasks());
}
This works as expected when running the application. The problem is that Eclipse doesn't like it. It says:
The method tasks() is undefined for the type ReverseApplication
While underlining tasks with the dashed red line. Is there a reason for this to happen? I've tried cleaning and compiling the project (through the Play terminal) and refreshing the project in Eclipse, but to no avail.
Is there something I can do about it?
I'm using Eclipse Juno, build 20120606-2254
Thank you so much!
Since the views are Scala code, they are compiled by the Scala compiler (ie your Play console through sbt). So Eclipse cannot compile and find these.
So, your best option is to configure Eclipse so that it automatically refresh the workspace and make sure that the folder "target/scala-2.9.1/classes_managed" is in your build path (it should be done by the "eclipsify" command).
If it does not work after all these steps, try "clean", "compile" and "eclipsify" (for Play 2.0.x) or "eclipse" (for Play 2.1.x) and refresh your projet.
Close and open your project in Eclipse. This worked for me (Eclipse Juno).
None of the previous suggestions worked for me, but when I did a refresh on the target folder, the red underlining on my view references went away.
The Play command used to be called "eclipsify". It is now called "eclipse".
Generally, I do the following and it works pretty well with Eclipse
-at the start of the day, start the play console in your project dir and do 'clean' and 'run'
-open a web browser point to the app (localhost:9000)
-launch eclipse
-make code changes...
-Play will rebuild the app whenever code changes occur. So refreshing the app in
the browser.
-back in eclipse, Refresh the project to reload the files that play rebuild just made.
I know it has been a year since #nico_ekito's answer but just wanted to add this.
Adding /target/scala-2.10/classes_managed and ensuring that Eclipse automatically refreshes the workspace fixed it for me. Thanks #nico_ekito
Using Eclipse Kepler, play framework 2.2.2

Gnatbench runs Ada program before compile

I have GNATbench installed in my Eclipse (Indigo) for coding in Ada; and for some odd reason, the program is first run and then compiled, which doesn't quite work when I update the code. I know the compiler works, because if I run the program manually it works fine; and if I hit run again, it runs with the proper changes made. A side note: I prefer using eclipse, and I'd rather not just compile from the command line. I am running Indigo on Ubuntu 11.4.
You should disable "Build Automatically" in the Project menu and then build manually before running. This can be done using the Ctrl+B shortcut.
odd. is it actually running? Gnatbench does a syntax/file check everytime it saves. I'd make sure your gpr file is correct and that your project isn't nested within another eclipse project or else eclipse can act kinda weird.