Automated building equinox PDE : executable doesn't work - macos

I created an OSGi project in which one I've 2 projects :
- one plugin project : that contains my source files, my product configuration that uses my feature project and the feature org.eclipse.equinox.p2.ui.user. It means that my program is able to install new software or to update the program.
- one feature project that contains my plugin project.
I can run my program into eclipse, It works. I can export my product configuration from eclipse and then launching my program : it works.
After that, I'd like to build automaticaly my program with the framework PDE of eclipse. I followed this tutorial : http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. pde.doc.user/guide/tasks/pde_product_build.htm . I'm able to generate my program for Windows,Linux and Mac os. The executables of windows and linux work. However, the executable of mac os doesn't work.
When I click on the icon, nothing happens and I've no error. To be able to launch on mac os, I've to replace the file myExecutable.app/Contents/MacOS/eclipse by the one of Eclipse.app/Contents/MacOS/eclipse. It seams that the file "eclipse" of my generated executable is not in the right format.
Do you know what is the reason of this problem? Or maybe if you have a clue for me to solve that.
Thank you very much,
Bat

If you right click on myExecutable.app and select 'Show Package Contents', you can drill in to find the actual executable. You can run this from a shell prompt and see any error output. You can also find the logs in the structure hidden inside the .app.
I'd recommending comparing the eclipse.ini files for your executable app and the one from Eclipse that is working for you. There may be a option that you are missing that you can add to your .product Mac OS X specific options.

Related

Xcode 13 and Linux Makefile

I searched and it seems all the answers are from are from many years ago. I'm working on a command line tool for linux/Mac that currently uses a Makefile. I wanted to use the Xcode debugger, so I tried to build an Xcode project, but I'm having some final difficulties.
I created a new project of type command line tool with external build target in the project directory. The default was to use /usr/bin/make. It ended up in a subdirectory, and based on several older web resources, I moved the project file up to the folder with the makefile. I added the source files in the folder to the project and right now I can edit and build from Xcode without difficulty.
The issue is that the final executable ends up in a subfolder called bin, and I can't seem to discover how to tell Xcode that that is the final executable. All of the resources I've found talk about adding a custom executable to the target from the project menu, but that menu no longer exists. Searching project help doesn't seem to point to any setting for the executable produced by an external build process. The closest build setting I could find was PROJECT_NAME, but changing that didn't seem to help.
Thanks.
Found an answer on another site. Edit the info tab in the scheme to identify the binary.

Connecting dots from self-contained Java application to Mac OS installation

I am not a Mac owner and am putting myself through a crash course to get up to speed (e.g., reading "Switching to the Mac"), to give you an indication of my current level of understanding. The access I have to a physical Mac is limited, so I am trying to connect as many dots as possible before my next session with my friend's computer.
I have: a file folder containing all resources needed for a self-contained application written with Java (OpenJDK 11, JavaFX 11). The JLINK tool was successfully used to create this file folder, and it holds all necessary Java libraries as well as the code I wrote for the application. The executable resides in a subfolder: /bin. The program runs perfectly well on the Mac when the executable is run.
I want: something that is easy to download, install and run.
I'm unclear about what needs to be done to get this. The road map seems to have two main steps:
the file folder needs to be converted into something that responds as if it were an application (e.g., a Bundle? or an .app?)
the resulting folder-as-executable can be shipped via either .dmg or .pkg
For the second part, I've researched and found tools such as Packages or create-dmg. It seems to me these tools are pretty straightforward and shouldn't be too difficult to learn to use. (Just have to pick one or the other or something similar.)
For the first part, I'm on shaky conceptual ground. I've found info about Bundles, but no tutorials, walk-throughs or examples. It looks like a key step is understanding how to make a proper Info.plist file, but doing this properly looks tricky. Also, I'm not clear on how the resulting Bundle will become an .app file or if it needs to, or if there is another, more direct way to make my file folder be viewed by the OS as an application.
Some hand-holding or references to tutorials or even assurance that I am on the right track (if that is the case) would be much appreciated. Thanks!
The Java Deployment guide from Oracle relies heavily on ANT, but doesn't cover the case of a self-contained, customized JVM via JLINK well enough for me to decipher. So, I've taken the approach of trying to learn/understand the necessary steps using command-line commands.
While creating a Bundle is certainly an option, there is an easier way.
Step one is to make an .app manually. An answer to this question: "How to make a Mac OS X .app with a shell script?" goes over the basic steps. The Java file system that results from jlinking has a folder /bin in which there is a bash file that runs the program. This file should be moved to the outermost folder, and it should be named the desired name of the application. The bash file itself will have to be edited and "/bin" added to the address in last command so that the executable will be found. In addition, the folder itself will have to be renamed to be the same as the bash file, but with .app added as an extension.
The next thing I wanted to have was a custom icon. The question "Include icon in manually created app bundle" shows how to do this.
For the next step I made use of the program "Packages". I'm a bit confused about where I downloaded this from (there seem to be multiple sites), but here is a link to the manual. This tool allowed me to create a .pkg file that, when executed, installs my .app in the Applications folder. Then I compressing the .pkg file (to .zip) and made it available at a URL for downloading.
I've had a friend do a test download and install, and the program works!
This isn't meant to be a complete tutorial, and there are a few steps more that I want to figure out pertaining to sandboxing and sealing, but I believe this is a reasonable roadmap that can be used for simpler jlinked Java applications for Mac distribution.

JavaFX Native Installer OSX Working Directory

On every other platform but Mac OSX, when I build and install a native package, the default working directory is "." to the JAR file. Even on OSX, if I delve inside the .app folder and manually run the JAR, the working directory is correct. However, if I run the application by simply clicking on the .app launcher, the working path ends up as "/Users/[username]
". Does anyone know how to configure the JavaFX native installer (perhaps info.plist?) to prevent this from occurring?
I think the launcher native executable sets this path. It is not plist configurable. The reasoning seemed to be in anticipation of OS X sandboxed applications and the limited file system access that they involve. So, basically there was no real good choice but they didn't want to encourage counting on access to the application bundle or it's parent directory.

create Qt project on windows operating system

i to create a QT project under windows operating system but when i try to run this application i found this error:
Starting C:\Source\test1\debug\test.exe...
The process could not be started!
can any one help me to know what is the problem
It sounds like you're trying to invoke this from an I.D.E. (like QT Creator) that can't find the executable.
Assuming it has been compiled, the I.D.E. may be trying to call it from the wrong directory.
Look in C:\Source\test1\debug and see if that executable exists.
If it's not there, it probably should be looking in C:\Source\test1\release.
Look there for the executable.
For QT Creator: I've found in the past that deleting the *.pro.user file and reopening the project works. The I.D.E. will ask/(force?) you to regenerate this file. Do so. This seems to fix many problems like this.
If you are using an I.D.E. as mentioned, it seems that your project configuration is broken. Save all source files and start a new project with the source files, and let the I.D.E. regenerate its scripts. Check the makefile for errors.

How to transfer Eclipse workspace and project from Windows to Linux and Mac

We have a a product developed on Windows for years. The product is composed of one Eclipse workspace and about 20 projects.
On Windows, we ask every developer check out projects into d:\dev\product folder, and copy a unified Workspace to d:\dev\prod_workspace. This way, whenever a new machine is set, we simply copy files to the same folder, and we can start working immediately.
Now we need to move our development environment to Linux and Mac. But there's no D:\ on Unix. And home folder for Linux is mostly like /home/username and /Users/username for Mac. We found Eclipse keeps absolute path in workspace when referring to projects, so simply copy workspace over does not work anymore. Even when we manually create/configure workspace on a Linux machine, it still cannot be copied over to another user, because the absolute path is changed.
I guess our goal is to allow easy setup of development environment. Do you have any suggestion to move eclipse workspace around?
I develop an Eclipse based product for Mac and WIndows (haven't tried Linux).
The solution I found to work best is to actually go and manually check out the projects in the workspace on each machine directly from source control. While the project structure does convert between platforms, any attaches, such as version-control stuff does not. I am not sure why, but I guess each thing has its kinks.
You may be able to able to hasten things a little by creating a project working set (or whatever it's called, I think it's a PSF file) for a platform, and then reuse it on all platforms.
Another problem is that Eclipse versions are not 100% compatible. One of the problems I have is with manifest files for plugins, which have different semantics (e.g., what to do with exported packages that don't actually exist) in each platform, causing a headache.
Finally, be away that Java on Mac and PC are not identical. In fact, Eclipse has two versions for the Mac. I usually end up running and compiling on Java 5 on the mac, which does have some incompatibilities with Java 6.
I have ported my eclipse project from windows xp to RHEL(never tried Mac)
Your task can be accomplished in the following steps :-
Use workspace variables in your project code rather than absolute path.
Shift your workspace to some location in linux as /Workspace or if you want to keep it user specific make the workspace folder as /home/user_name/Workspace.
There is an option to change all the \ of windows to / in linux. The option can be found under the file menu in eclipse.
Change the settings of where to find classpath directories, the options can be found by just right clicking on the project menu in the project viewer panel.
There is an option to build the project clean from scratch. You just have to click on the option and eclipse would re-compile the project.
Once all this is done, and all your database connections have been successfully ported to linux, you would have a working project running in linux as well.
I can think of two ways to do this:
Use workspace variables in Eclipse to point to the exact location where the workspace sits, if you need that. Then the developer can put everything in the workspace on Windows, Unix, whatever, then define the variable and you're done, or
If compilation is always done from within Eclipse, meaning you don't truly need any absolute paths anywhere, then change the projects to all use relative paths and check the Eclipse classpaths, etc, into source control. Thus, when a developer checks out everything in Eclipse, the classpath and .project file will be at the root level in the project and all paths will be pre-defined.
For option #2, you may need to have multiple .project or .classpath files, and have the developer copy the appropriate one into location. That is, copy .classpath.win into .classpath for Eclipse's use.
If you check out the projects from a source repository, then consider using Team -> ProjectSets to handle these.
Preferences can be saved in a file and loaded.
We tried classpath variables and loathed them. Now we just have everything in single projects in the source repository.
Use the Workspace Preference Transferrer plugin
This allows you to transfer the workspace settings from a given workspace to another via new options in the 'switch workspaces' dialog.
I'll share my own solution:
Zip the workspace. Just zip the entire file and then transfer it over. Then, all you need to do is delete the default drive reference:D:\ ...or whatever ends up appearing in the beginning of your file name. Then all you need to do is drag it over to the new empty workspace on your newly downloaded Eclipse.

Resources