Problem: I have created a Desktop Application with Java and SWT/JFace.
The project contains design, action, util and model classes. Created executable jar, All works fine but now i am facing some branding and endorsing issue i.e.
- Minimize should display in task bar.
- Running executable jar is showing as a javaw.exe in task manager list
not with its name.
- On alt + tab application appear as unknown exe
Now I want a suggestion. Can these issue be solved easily without impacting a lot if yes then please provide needed clue? or should I go to Eclipse RCP plugin productization which can handle all above means.
If sole answer is No, Then please suggest an optimize way to migrate to eclipse RCP. it would be nice if you point action list as I am new in such productization.
Update As i have created GUI by SWT/Jface and, using main as entry point I have created its executable jar, is this creating problem that i hav mentioned above?
Related
Please bear with me, if my question sounds bad.
I am working with a project (java eclipse), I had the code base in my office laptop, it works fine, now I need to get inside the code/project so that I can modify when needed.
I can code in java (intermediate level), but I am a beginner at eclipse stuff, specially eclipse application/plugins.
I am spending lots of time reading/watching different tutorials on eclipse (like vogella, o7planning, help.eclipse, etc.) but got confused on all these different stuff, RCP, SWT/jFace, Java GUI, windowbuilder, etc.
I need to know How "this" (my project that I'm working) got started? Is it a eclipse RCP? seems like a RCP, but there is no OSGi,
Here is a list of what it has (other than .java, JRE library, Plug-in dependencies),
META-INF, build.properties, a product file, a launch, h2 connectivity, a plugin.xml
From user point of view, this program has several menus, views,
I was able to open some views in windowbuilder editor (not all views/menus)
some java classes named as handler (part of name).
Any suggestions (reading materials) how to start with this project to understand it completely will be really helpful.
Is there any way to reproduce the whole project (using all the codes/java files that I already have)?
One way to do reverse engineering is by going through plugin.xml.
vogella is a good tutorial you will find all major eclipse rcp related tutorials.
You mentioned menu go through your plugin.xml you will find org.eclipse.ui.menus extension and associated handlers.
https://www.vogella.com/tutorials/EclipseCommands/article.html
Do your plugin project contains.xtend files go through https://www.eclipse.org/xtend/documentation/101_gettingstarted.html
Do your plugin project contains xtext files go through DSL
https://www.eclipse.org/Xtext/documentation/102_domainmodelwalkthrough.html
I originally asked another question regarding the specific issue of not being able to create an .exe file, but after trying three different methods that gave me three different errors, I've come to the conclusion that the problem has something to do with the use of JavaFX itself.
Long story short, I wrote a small program on Apache NetBeans 11.3 that uses JavaFX for the GUI. It has a class named Main that extends Application and another one called Launcher that does not, and whose purpose is to call Main.main(args).
I have tried in vain to create a runnable file of some sort for this program using NetBeans.
Under the Packaging project properties, I ticked Compress JAR File, Build JAR after Compiling, and Copy Dependent Libraries. Under Deployment I ticked Enable Native Packaging Actions in Project Menu and Keep JavaFX artifacts on Compile Classpath if not present by default. These are the same settings I found in every tutorial, although the tutorials I found were for version 8 or older of NetBeans.
When I try the standard "Clean and build" option, attempting to run the resulting .jar from the command prompt returns the following error:
Graphics Device initialization failed for : d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
Along with a ton of other lines I can copy/paste here if it's deemed necessary. I've tried the solutions I found online, but none of them worked.
I tried creating a Maven project, but the error returned is no main manifest attribute. Fixing this error by adding the location of the Launcher class to the MANIFEST.MF file (Main-Class: orionindustries.passwordalgorithm.Launcher) results in a different error: Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application.
I installed Inno Setup to try to create an exe file, but I get yet another error: typedef class com.sun.javafx.tools.ant.FXJar cannot be found
using the classloader AntClassLoader[].
I tried enabling the Switch Project to JavaFX Deployment Model setting under Deployment in the Project properties, but it says the JDK doesn't support JavaFX and doesn't allow me to select any JDK when I try to solve it.
I've no idea what else to do. In the previous (now-deleted) question someone mentioned JDK 14 would come with a packaging tool, but that's not a real solution to my problem, it's just using another tool for something that NetBeans is supposed to be able to do (and even then, there's no guarantee that it'd work). Either I'm screwing up massively, or NetBeans has serious bugs that somehow went unreported.
I've created an Eclipse Plugin clicking New > Plug-in Development > Plug-in Project.
In this project, I've modified the plugin.xml file and added new Views to create an example, and it works succesfully when I press Run button, loading a new Eclipse instance in which I can show my example perspective whit its views. It looks like this, with my additions marked:
MyPerspectiveAndViews
Now I want to create (I don't know what I need exactly) something to execute it without pressing the Run button, something like a Jar file.
I've been taking a look on Internet and I learned that Eclipse provides a tool call Oomph (also called Eclipse Intaller), and with Oomph I should create:
Product Setup Model
Project Setup Model
It seems like de Project Setup Model file can be added to an installation process. So I search for tutorials to do it, like https: / / eclipsesource.com/blogs/tutorials/oomph-basic-tutorial/, getting the setup file, like this:
MySetupFileCreated
But when I create the project setup model, I don't know how to include my example project, so I can't show my perspective with my views.
Anyone knows how to create it in an Eclipse RCP application like this example?
Thanks :)
Looking into Eclipse 4 RCP.
Did the following:
Created an Eclipse Plugin Project (no Rich Client unchecked,
Actvator unchecked) so no classes under /src
Created a Product Configuration. Application selected is
E4Application
Created a Feature Project and include the plugin I created in step
1
In the .product file I checked the configuration to be based on
features. In the dependencies tab I added org.eclipse.e4.rcp and
the feature I created in step 3 (added required dependencies as
well)
Created Application Model with container to be the plugin project
of step 1 and added a New Trimmed Window
Saved all and tried to launch an Eclipse Application
No window is showing up and I don't see an error in console.
Any idea what am I missing here or how is this debugged?
Update:
I am following: 10. Tutorial: From Plug-in to Eclipse 4 application
The 10.6. Start application is the one that fails
Update 2:
I noticed that some directories have been created outside of my workspace with the name runtime-todo.product (i.e. the plugin name).
Going into runtime-todo.product\.metadata\.plugins\org.eclipse.e4.workbench and deleting the workbench the window showed up.
Why are these directories created outside my workspace and what was the problem here?
I followed all your steps and got the expected empty window after the application started, so something is strange here.
You can try to:
Look for an error log file in the .metadata folder of your runtime workspace
Delete the file .metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi
Add -clean as a program argument to your product launch configuration
Try to start the application again.
If this doesn't help, you can set a break point at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel to see what happens when Eclipse tries to load your application model (see also Eclipse 4 Source). I hope this helps!
[Update]:
When you start your application, a runtime workspace is created. Here, all the meta data of your application is stored, like settings and resources. For example, in .metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi the user settings of the Application Model are stored.
Sometimes during development, this workspace can become corrupted (e.g. by stopping the application while debugging before settings are saved etc.).
You can see the location of your runtime workspace when you look into the Run Configuration of your application. In the Main tab you can see (and change) the workspace data location. You should keep this runtime workspace separate from your development workspace.
[Update 2]:
Information about the role of the workbench.xmi file can be found here: Constructing the runtime application model. The web page of Lars Vogel offers a lot of useful Eclipse Tutorials at Eclipse Plugin and Eclipse RCP Tutorials.
The Eclipse Help page lets you browse the user and developer guides or search for specific topics. Information about the Eclipse launcher and thus the runtime can be found here in Plug-in Development Environment Guide > Reference > Launchers > Eclipse Application Launcher. Look under Main Tab for explanations about workspace data.
The Eclipse variables are explained in the run configuration dialog of your application. In the main tab, look for the Variables... button. When you select a variable, an explanation is given in the Variable Description field.
You can check the Clear flag in your run configuration or specify -clearPersistedState in your product definition ... as mentioned here in a Lars Vogel Tutorial (search for Problem "Application model changes are not reflected in the Eclipse 4 application" in Table2).
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