Eclipse run configuration for Play Framework - java

I am currently trying to run a test application based on the Play framework. The project was created using the command line tool for play and then converted into an eclipse project by using
play eclipse
The documentation says that this step also created a run configuration to run the code from eclipse.
But there is no configuration created.
After pressing run, eclipse is looking for a main method that is not existing.
I also tried to launch the project from the command line using play ~run.
But I have included and imported a class from another project and the compiler always ends with an error saying the imported package could not be found.
Thanks for your help.

play eclipse (or play eclipsify for previous versions) is only so that you can import your project in Eclipse and use the debugger, get auto-complete, etc. You're still meant to run the application from the console though.
As to the second part of your question you'd need to provide more details. What exactly do you mean by, "I have included and imported a class from another project"?

The solution for the problem was, that external libraries have to be included in the /lib folder of the project as .jar-Archive. The folder was not auto-created. All libraries in this folder will be added to the build-path of play automatically.

Related

Cannot run project - the selection cannot be launched and there are no recent lanuches

i have following problem:
Yesterday i worked on my selenium&maven project in java on eclipse and after work i export project as archive, today i want to import whole project and run it on second computer, but i receive 'the selection cannot be launched and there are no recent lanuches'.
I tried run configuration, but there's no effect.
My archive is available here: https://drive.google.com/open?id=1BB0tqege1iWE_qdbHSEhfvNuFqPa8SO7 or https://github.com/mtpx/af/tree/master/automationFramework
How can I execute this project?
It using Selenium, Maven and TestNG, so there's no main class here
Maybe the project you have in hands was not exported properly, missing important metadata for the compiler.
Make sure the project is being correctly exported using (right click) export option and not only copy+paste/zip+share.

Unable to config and run a Java project in IntelliJ

Me and a few other students are building a game with Java at university. Someone else setup the basic structure for the project and i pulled the repo and tried to run it.
When i run it i get
this window
When i open the config, i am unable to add the main class, it is located in the file shown in the image. The OK button is disabled. You can see that here.
I'm running the latest version of IntelliJ, JDK 9 and Windows 10. The project in question is built with LibGDX. The full repo and folder structure can be seen here.
I am able to setup my own project and run my own apps, i just can't run this specific project.
Please help.
I think, since you have no "Java" directory, Intellij does not recognize any folder as Java Sources. You'll have to do that manually by rightclicking and mark the desired directory as Source root.
I figured out what the problem was, and of course - it was obvious. The project was setup with an old version of Gradle (2.4) and i was running Java 9. I installed Java 8 and made the project run.
The OK button was disabled because the project hadn't built properly (i though it had) so it couldn't find the class i needed to run it.

Launching an ImageJ plugin from NetBeans throws a JNI error. Launching it from ImageJ alone works fine

I have an ImageJ plugin and its sources which require a .dll library in order to operate. The plugin is working perfectly fine when I throw it int the ImageJ plugin folder, no problem.
But I have to modify the sources to add new features so I opened the project in NetBeans (it was already a NetBean project) and tried to start it from the IDE with a simple test class that start ImageJ and sets the plugin dir to the project dist\ dir. This works for all my other plugins but here I get an UnsatisfiedLinkError.
After some research and use of Dependency Walker I found out that I missed some .dll's in the project path. Now I have them all in the right places, executed with the -Djava.library.path="paths_to_all_my_libs" and I still get the error, Specific procedure not found.
It's really bothering me because I have to copy the .jar in dist to my ImageJ's installation, risking to mess things up and I can't use the console to output debugging stuff. Also I don't understand why I can't get it to work within NetBeans when everyting is fine with ImageJ alone.
Any idea is very welcome !
You can go with two approaches here:
make sure to add your dll location to PATH
if you don't care about location (e.g. you are developing something for your own), use exact location of dll by using System.load - it takes explicit location of library as argument

Eclipse plugin not working properly

I developed an Eclipse plugin that compiles and runs java code in German. The technique I am using is that I translate the code to English and pass it to Java Compiler and get the results back and print it in the console.
The problem is that the plugin works when I run the plugin from Inside Eclipse but when I install the plugin in Eclipse so that when I open Eclipse it already exists there and start to test if a real user uses my plugin and creates a new Java project and try to the compile button in my plugin it says [The chosen operation is not currently available] ![Here is the the way I run and it opens a new Eclipse application with the installed plugin ]
Any help please
the way you installed your plugin sounds a little weird to me. So at first please try to export your plugin via the Export Wizard.
(Select Export -> Deployable plugins and features from your projects context menu)
Export your project as jar file and copy it to the 'plugin' folder of your eclipse instance.
After that it might be helpful to debug your plugin on OSGI-Level as there might be a problem loading your plugin (at least the error description you have posted indicates that).
Run eclipse with -console -noExit -consoleLog flags to open an OSGI console for debugging. After that try running ss <your-plugin-name> to see what the state of your plugin is.
The output gives you the ID of your plugin and the state it currently has. If the state of your plugin is not ACTIVE try running start <your-plugin-id> to see whether it starts correctly. If there is a problem starting your plugin you should get a respective log message. Feel free to post it here in case you need further help.
Otherwise there are plenty of options what might cause your problems, so maybe its better to try the steps I have described above before getting into details.
If you want to run eclipse plug-in withput using Eclipse Application , then you need to make a Feature project.
Now if your algorithm has something to do with system Path , you must
check Unpack plug-in and you should read the resource accordingly.
Like PLatformUI.getWorkBC() etc..
No other eclipse plug-in (jar) should be inside plugins directory of eclipse of same name of your plug-in. Ensure for this.

Integrating BlackBerry application with Flurry

Has anyone been able to successfully integrate Flurry with a BlackBerry mobile application? I have imported the FlurryAgent.jar into my project, yet when I go to run the application I am given the error "Module 'FlurryAgent' not found." I have tried the following:
Preverifying the .jar file
Adding the .jar file to the build path of a library project (that my main project references)
It is still not working for me after trying the above - I'm getting ready to pull my hair out, there really isn't a helpful guide to do this.
Thanks!
In your project properties, go to the Java Build Path section, and then the Order and Export Tab. Make sure the check box for the Flurry component is checked.
That solved it for me.
Flurry was working fine for me in an application I did a year ago. I just added the FlurryAgent.jar file to the build path and then called FlurryAgent.onEvent(String);
I was using NetBeans IDE with Blackberry JDE 4.5
The supplied jar is already preverified, so that should have no effect. Mugur is right that the flurry jar must be included in the build path of the application project and must be included in the built application.
We (Localytics) provide our client libraries in source code to make integration with BlackBerry much, much easier.
We compete with Flurry, but you might want to give it a try: http://wiki.localytics.com

Categories