Eclipse Helios fails to load toy plugin - linux

I am trying to install a toy plugin that I wrote in Eclipse Helios 20100617-1415 under Fedora 12. Attempts at installing the plugin have all failed. The plugin does actually run when executed as an Eclipse Application (another copy of Eclipse is loaded and the plugin appears on the menu and does what it's supposed to). I put the jar file for the plugin in the /dropins/plugins directory and after several reboots Eclipse fails to load it and seems to not generate any error messages either. I also tried to load it directly using the Install New Software UI and that failed (added a directory where the toy plugin is and the response is: a dialog box pops up: No software site found at DIR_NAME. Do you wish to edit the location? At the same time in the name list area box behind the popup it says: Could not find file:DIR_NAME (the directory is valid and the jar file is there) - the other attempts are to load the jar file directly selecting archive instead of local in the Add Repository dialog - that too fails: first the jar name is mangled somewhat to jar:file:/DIR_NAME/TOY_NAME.jar!/ and then the same error messages come up already mentioned for just trying to use the directory location). So the installation mechanism is a complete failure but - how can I get it working? (Yes I can install plugins from the Eclipse marketPlace and other repositories). Thanks!

There are several ways to install your plug-in,
put your plug-ins into "dropins" folder if your eclipse enables polling that folder. The structure should look like below,
-dropins
-cdt
-features
-plugins
-myplugin_1.0.0.jar
export your plug-ins to your eclipse via menu 'File' - 'Export' - 'Plug-in development' - 'Deploy plug-ins and fragments' - 'Install to'

Related

Can Gnome Builder actually produce something else than flatpaks?

I can't seem to find any documentation as to how to configure builds to produce something else than the pre-configured flatpaks. Duplicating build configurations and changing the settings doesn't seem to give me the option to produce anything else than flatpaks. Changing the application runtime to "Host System" produces only flatpaks as well. I can't even find the preliminary binaries that seem to be produced somewhere before they're packaged. What am I doing wrong?
For reference, I am using Builder 3.36. My assumption based on your post is you're looking only for your application binary, and not a way to build some other package like .deb or .rpm.
There are a few ways you can do this.
Method 1: From your Flatpak build's directory
Click the omnibar and click "build", not "Export Bundle". When it's completed, click the "View build console contents" button from the same omnibar drop down where the "Export Bundle" button is.
Look at the last lines of output in the terminal for the "flatpak build" command. Look for the "build-dir" parameter passed to this command.
The path will be something like "~/.cache/gnome-builder/projects/AppName/builds/org.your.App.json-flatpak-org.gnome.Platform-x86_64-3.34-unversioned"
Go into this directory. It will have a subdirectory "src" which has your app.
Method 2: Change build configuration
If you click the "Switch Surface" button in the top left and go to "Build Configurations" you should see two configurations created for you by default (if you created the project through Builder). Builder defaults to your JSON file which builds Flatpaks.
Click the "Default" configuration, then click "Make Active" under "Overview". Then you can build the app as normal (e.g. with the omnibar at the top). Once it says "Build succeeded" the binary has been built.
But where? Look for the path listed in the "Overview" for the "Default" configuration -- under "Install Prefix". This will be something like "/home/user/.cache/gnome-builder/install/AppName/host"
In there is a "bin" directory with your app.
Method 3 (Preferred): Build using ninja
From the Editor surface, press CTRL+SHIFT+ALT+T to open a terminal inside Builder, which defaults to your $BUILDDIR
In the terminal that's open, simply type "ninja". If it says "ninja: no work to do." your app is already built and up to date. You can type "ninja clean" and then "ninja" if you want to do a fresh rebuild.
Inside this directory, (something like "~/.cache/gnome-builder/projects/AppName/builds/default-host-unversioned") there will be a "src" directory which is where the app is built.
Running your app
You may not be able to double click this from a file manager, so open the directory in a terminal and type "./appname" to run the app.
In addition to wappa's answer, for GNOME Builder 43, the file system is ~/.var/app/org.gnome.Builder/cache/gnome-builder/projects/<your-project-name>. The default build directory is builds/<your-application-id>.json-flatpak-org.gnome.Platform-43-x86_64-main under the file system; you can find object files, executable files, Meson and Ninja files including build.ninja, etc. here.
Besides, you can find the output Flatpak files at flatpak/staging/x86_64-main under the file system. To export a Flatpak bundle, you can click the down arrow on the top bar and click "export". The exported Flatpak bundle is at this directory. The executable binary file is under files/bin. You can also find application data, icons, font configurations, etc., under the files directory.
To configure the location, you can still click the down arrow on the top bar and click "Configure Project...". On the "Overview" page, you can view which configuration you are using currently, corresponding to the configuration options on the sidebar: "Default" (~/.var/app/org.gnome.Builder/cache/gnome-builder/install/<your-project-name>/host) and <your-application-id>.json. By default, the latter one is selected, whose installation prefix is /app. If you look at the Build Output, you can observe that the desktop file, source files, GSchema XML, AppData XML, Icons, etc., are installed into /app. The /app is the path in Flatpak's sandbox filesystem rather than the path in the main filesystem of your Linux OS.
If you want to avoid using Flatpak, you can go to the build directory and manually build by Meson and Ninja.

Simple guide for installing Eclipse multi-user on Linux

Is there a simple guide available anywhere on how to install a recent version of Eclipse on Linux as a "normal" application?
The version in the Debian repositories, even for Debian 9, is a 3.X version of Eclipse, which must be very old, as they are now at V4.7.
The default method for the "eclipse.org" versions to install themselves is to put everything in the home directory, which is not a great approach for a system where the home directory is supposed to only contain user data (e.g. the whole home directory is backed up daily)
I can't believe that something so widely used does not have any good instructions for how to install it as a normal application would be - where all the application files are in a shared folder under /opt, and only user data is stored in the home folder.
I have found this thread, which may be promising:
https://www.eclipse.org/forums/index.php/t/1080525/
And a previous question seemed reasonably good, but on trying to follow it, the installer screens have changed, and everything about "bundle pools" became very confusing!
https://askubuntu.com/questions/695382/how-to-install-eclipse-using-its-installer
Not sure if you are still looking for an answer. This is how I have been doing for a few years now.
Download it from website and extract eclipse folder under /opt
Change ownership of the folder to your user and make it readonly recursively.
Create a desktop file to launch it as a regular user.
You can make the folder writable once in a month to make sure latest updates are installed then make the folder readonly again.
TL;DR give up now
I found this when Googling for how to do a multi-user install on Linux Mint 20.
Although Eclipse publish specific documentation on how to do a multi-user installation this little correlation with the current reality.
I first tried installing the package version of Eclipse. That installed the flatpak package, not a native package. It turns out that flatpak has a bug (opened in 2017) whereby it creates a new image each time you run the binary - and at 1.2G that was eating my enterprise storage very quickly. Although the package installed from the command line use apt it did not add any record to the installed package list - so I couldn't uninstall it with apt (using flatpak uninstall eclipse seems to have worked).
I then downloaded the tarball eclipse.
This has a GUI installer which would not run via [x]sudo - so I had to subvert the usual security model on Mint/Ubuntu and make the root user a logon account.
I specified the install location as /usr/local/eclipse. The installer did its thing. Sadly it did not provision a menu entry for the program. Since it actually installs in a sub-directory of the target named with versioning information (/usr/local/eclipse/jee-2019/12/) I created a shell script in /usr/local/bin/ to point to the binary (so when I upgrade, I just need to change the shell script to point to the new location). I then created a .desktop entry to run the shell script and ran:
xdg-desktop-menu install --novendor eclipse.desktop
I also copied the eclipse.desktop file to /etc/skel/Desktop and to /root/Desktop
From my root session, opening the .desktop file by double clicking, or running the shell script started eclipse.
Sadly, this did not create a start menu entry (it has worked for me with other applications).
Logging on a different user, copying the .desktop file to ~/Desktop and running it resulted in....
(Of course it would have been far too easy to display the failure reason in the dialog, or even put the path to the log file in a widget where I could copy and paste it)
Looking at /usr/local/eclipse/jee-2019/12//eclipse.ini, I find this:
-startup
plugins/org.eclipse.equinox.launcher_1.5.600.v20191014-2022.jar
--launcher.library
/root/.p2/pool/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1100.v20190907-0426
-product
org.eclipse.epp.package.jee.product
-showsplash
/root/.p2/pool/plugins/org.eclipse.epp.package.common_4.14.0.20191212-1200
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
/usr/lib/jvm/java-11-openjdk-amd64/bin
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=#user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx1024m
--add-modules=ALL-SYSTEM
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
There is a whole catalog of issues here.
I replaced the relative path for -startup with an absolute one, copied /root/.p2/pool to /usr/local/eclipse/pool and updated the -startup and -showsplash entries in the file.
I got a whole new error message:
!SESSION Fri Feb 19 11:11:27 GMT 2021 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2021-02-19 11:11:27.893
!MESSAGE Could not find extension: reference:file:org.eclipse.osgi.compatibility.state_1.1.600.v20190814-1451.jar
!ENTRY org.eclipse.equinox.launcher 4 0 2021-02-19 11:11:28.070
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
...
I get exactly the same error after converting the Fedora 33 RPM to a .deb and installing that.
I'm going to go check the price of intellij licences.

running example in drool planner 5.5

I am new to the drool planner, and try to run example using runExamples.bat,but when try to import that example in exclipse and try to run following exception is getting
Exception in thread "main" java.lang.IllegalStateException: The directory dataDir (D:\OfficeWork\Eclipse_work\Cloudbalancing2\data\cloudbalancing) does not exist. The working directory should be set to the directory that contains the data directory. This is different in a git clone (drools-planner/drools-planner-examples) and the release zip (examples).
at org.drools.planner.examples.common.business.SolutionBusiness.updateDataDirs(SolutionBusiness.java:101)
at org.drools.planner.examples.common.app.CommonApp.createSolutionBusiness(CommonApp.java:55)
at org.drools.planner.examples.common.app.CommonApp.<init>(CommonApp.java:35)
at org.drools.planner.examples.cloudbalancing.app.CloudBalancingApp.<init>(CloudBalancingApp.java:27)
at org.drools.planner.examples.cloudbalancing.app.CloudBalancingApp.main(CloudBalancingApp.java:33)
For OptaPlanner 6.0.0.CR4, I've made that exception message clearer:
java.lang.IllegalStateException: The directory dataDir (...) does not exist.
The working directory should be set to the directory that contains the data directory (which is not the data directory itself).
The working directory is different in a git clone (optaplanner/optaplanner-examples) and the release zip (examples).
In an IDE (IntelliJ, Eclipse, NetBeans), open the "Run configuration" to change the field "Working directory".
As for your second question:
Are you using the eclipse drools plugin? Try disabling it.
That DRL is fine, but the eclipse drools plugin might incorrectly mark it as an error. Note that Eclipse doesn't actually compile the DRL, so the only advantage of having the eclipse drools plugin enabled is syntax coloring in DRL.

phonegap Blackberry webworks plugin

I am trying to create a BlackBerry Webworks plugin using Phone gap. I am trying to follow the instructions given in this link:
http://wiki.phonegap.com/w/page/35799737/How%20To%20Create%20a%20PhoneGap%20Plugin%20for%20BlackBerry%20WebWorks
however, the directory structure mentioned in the link and mine vary significantly, also there is no build.xml in the root directory to run the
ant create-plugin command,
Since Phonegap being converted to Cordova Project, has something changed in the process to be followed?
Thanks in advance.
Currently the way plugin is added is different:
Add customplugin.js to your project's www folder and include a reference to it in your html file after cordova.js.
Add the plugin source to your cordova.jar in your projects ext folder. Open cordova.jar with your favorite archive manager or use the jar to copy the CustomPlugin.java file into org/apache/cordova/plugins directory.
In your projects plugins.xml file add the following line:
ref:
https://github.com/phonegap/phonegap-plugins/tree/master/BlackBerry/ChildBrowser

How to run NDK samples?

Sorry to ask such a noob question, but the NDK documentation is wrong (r7b):
If you are developing in Eclipse with ADT, use the New Project Wizard
to create a new Android project for each sample, using the "Import
from Existing Source" option and importing the source from
<ndk>/apps/<app_name>/project/. Then, set up an AVD, if necessary, and
build/run the application in the emulator.
There is no "apps" folder, and the samples do not contain a "project" folder. So ... what is the correct way to run a sample?
Also, can I configure Eclipse to build the C++ portion of the code automatically?
Click File | New | Project...
Choose Android project, Next
Project Name: This is the project name shown in Package Explorer. It is just a string stored in the .project file that Eclipse creates. No file or folder is created with this name, and the output binaries do not seem to contain this name.
Click "Create project from existing source"
Location: choose the project's root folder, e.g. .../android-ndk-r7b/samples/bitmap-plasma
Click Next and choose your target API. Eclipse does not seem to allow this to be changed later, at least not from the GUI. I don't know why Eclipse does not simply get this information from <uses-sdk> in AndroidManifest.xml or from the "target" line in default.properties. I also don't know why the two may be different (e.g. in the bitmap-plasma sample, target=android-9 but <uses-sdk android:minSdkVersion="8"/>.)
Click next and consider changing the "Package Name" field which defaults to "your.package.namespace". However, the project will run fine if you do not change this field. Leave "Create Activity" and "Create a Test Project" unchecked.
Click Finish. Eclipse will create numerous extra files (e.g. .classpath, .project, project.properties) and folders (bin, gen, assets) alongside the existing code. That's in addition to the output folders created by ndk-build (obj and libs).
Eclipse won't build the native code by itself, but it will automatically deploy the native code (e.g. libplasma.so) if it is aware of it. After you build the native code on the command line, e.g.:
C:\...\android-ndk-r7b\samples\bitmap-plasma>..\..\ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi-v7a/gdbserver
Gdbsetup : libs/armeabi-v7a/gdb.setup
"Compile thumb : plasma <= plasma.c
SharedLibrary : libplasma.so
Install : libplasma.so => libs/armeabi/libplasma.so
"Compile thumb : plasma <= plasma.c
SharedLibrary : libplasma.so
Install : libplasma.so => libs/armeabi-v7a/libplasma.so
Right-click your project and choose "Refresh", otherwise Eclipse might fail to upload the native code when it starts the emulator.
Finally, to run the sample, right-click the project and choose Run As | Android application. See here about choosing which emulator is used.
See here about configuring Eclipse to build the native code automatically.
I am curious why NDK produces two *.so files with very different sizes for each ABI, e.g. it creates libs/armeabi-v7a/libplasma.so (15 KB) but also obj/local/armeabi-v7a/libplasma.so (63 KB). Anyone know the difference?
Instead of going the long winded way ( seasoned programmer love it - but for beginners). There is a way to build the native library in Eclipse and NDK.
1> First you need to make sure NDK path is correct in Windows -> Preference -> (tabs) Android -> NDK - If not set - point it to ndk directory.
2> Assuming you have you imported project as described above (New | Project | Create from existing code) - You right click the project and go to " Android Tools -> Add Native Support ..". If the path is set it will build the example. And then you can deploy it to the device or AVM by pressing the play button.
SOURCE
I'm working with Eclipse ADT and Android ndk 5b. My correct path to the project is android-ndk-5b/samples/project
When you import from existing source you have to choose a correct target, I use Android 2.3.3.
After, I've updated my project from command line, look this link, http://developer.android.com/sdk/ndk/overview.html
From the samples path write: android update project -p . -s and $Your_Path_Android_ndk/ndk-build
Finally, only run as android app in Eclipse and it's done
It seems that with Eclipse Juno, you can now
Click File | New | Project...
Under Android category select Android Project from Existing Code and click Next.
In Root Directory you can then browse and confirm your sample project location.
From here, Eclipse can automatically detect the jni and find the projects.
If this didn't work, go to terminal or command prompt and navigate to your project root directory (where you see jni folder). Then input
android update project -p . -t <your target level>
Here should be, e.g., android-9
After this, try again the initial steps.

Resources