Schema missing from eclipse plugin environment - java

I am getting this in my plugin perspective. I get a generic menu istead of specific items e.g. action, etc.
(source: sourceforge.net)
My "Preferences / Plugin development / Target platform" looks like :
(source: sourceforge.net)
When I go to edit it looks like :

Is this similar to this thread?
I just figured out what was the problem.
I was using an external target platform to run my plugins, where I had installed only the basic plugins.
After I installed the sources org.eclipse.platform.source_2.1.0 and org.eclipse.platform.win32.source_2.1.0 also on the target platform, the manifest editor in the PDE was working normal again.
(to be adapted to your Eclipse version)
Also confirmed in this more recent thread:
Your target platform (and the default will be your own eclipse install) needs to have the source bundles (which provide the schema files used by these menus).
i.e. if I installed the runtime version, I will only get Generic in the menus but if I install the SDK version I will get real elements.
Thank you very much for the answer.
I "Add" source file to the platform (Preferences / Plugin development / Target platform) and got all menus!!

Related

Impact of Eclipse version on Code version

Does the version of Eclipse affect the version of code? Suppose, developers are using different version of Eclipse for same version of code with same version of JDK. Will it cause any issue?
No, the version of Eclipse does not matter.
Eclipse has extensive configuration for exactly which version of Java you are targeting. For example see the 'Java > Compiler' settings in the Preferences, and the 'Compiler Settings' in the Properties for a Java project.
You can also tell Eclipse which JRE/JDKs you have installed (see the 'Java > Installed JREs' page in the Preferences). You can run your code using any of these JREs, this is completely separate from the version of Java you are using the run Eclipse itself.
You do need to run a version of Eclipse which understands the version of Java you want to use. So for Java 13 you need to use at lease Eclipse 2019-12.
Of course newer versions of Eclipse contain more tools for helping with Java development and more bug fixes so using an up to date version is recommeneded.
Eclipse is simply an IDE (Integrated development environment). It combines debugging, compiling and other convenient tools for development. on the other hand, the Java code itself is separate, and you don't necessarily need eclipse to write the code. In fact, a simple text editor is enough. All you need is a file with a java extension (Example: hello.java).
It depends on what users share. I'm assuming you're using some sort of SCM, in which case the same project (fully shared) on different versions of the IDE can possibly lead to annoying situations.
There would be no issues in general, as far as producing the code is concerned, except in situations where some versions of IDEs don't support the required Java version (or other features). But I see this more as the user being affected rather than the project/code.
Here's what you should keep in mind:
Keep IDE project configuration files (such as .project, .settings, .classpath) ignored by your SCM system
All Java configuration should be based on a build tool. Use Maven/Gradle, etc, and any modern IDE will be able to create a project from its config file. The IDE would derive local configuration files which should not be sent back to shared repositories
This way, all developers are free to use whatever IDE (and whatever version) without causing interference, and CI tools will work off build tools' configuration as well.

IntelliJ terminal jdk setting

I have a project in IntelliJ Idea that uses jdk 8. In my system I have many jdk installed for development. Every time I create a new terminal window inside IntelliJ, the latest system jdk (jdk 10) is used and not the project one (jdk 8 in this case) and I have to switch manually. Of course I realise the error only after some build which requires jdk 8 does not work properly.
Is there a possibility to set the jdk used in IntelliJ terminal?
Check Preferences->Tools->Terminal do determine the used shell implementation.
Change the shell path or change your environment settings with the used shell to take effect e.g. for setting JAVA_HOME and PATH.
You can even use the "shell integration" flag to load a custom rc config file. Please check the IntelliJ documentation for this.
You are not able to use the configured projects JDK in a dynamic way. If you need this, please file an enhancement request to Jetbrains.
You need to change the SDK version in project structure. You can change it through IntelliJ navigation top bar, by following this path:
File > Project Structure > Project tab > Project SDK
I repost the answer of #yole from the comments. It is not possible.
For anyone else who stumbles on this question, here is how I resolved a similar issue:
Maybe this is just my company's security*, but when a JDK is installed with an .exe, something like the following path is created and added to the root of the %path% variable:
C:\Program Files\Common Files\Oracle\Java\javapath
On that path you'll find a 'java' executable for the installed version of java.
The fix was to simply uninstall that version of java, via the system settings.
* I mean that I was unable to see the 'true' path variable, may have been my company's security.

Create a distributable Eclipse bundle on MacOS

our company uses the Eclipse IDE with some plugins that are required to start our platform. I want to create a bundle for our Java developers that contains the latest Eclipse Java (Oxygen) with the plugins already installed.
So far I've installed Eclipse with
sudo cask brew install eclipse-java
which created an /Application/Eclipse Java.app.
After installing the plugins within Eclipse with Help->Install New Software the ~/.eclipse/ was created in my home directory.
Is there some way to zip these folders to create an distributable package of eclipse or am I missing other files/directories?
Is it possible to move the plugins in the installation directory as well?
Thanks for your help!
It is not advisable to use any Eclipse distribution that's produced by packaging tools. It's best to download directly from eclipse.org, for various reasons.
As for customizing an Eclipse "package" for distribution yourself, have a look at the Oomph project, which is designed for that exact purpose (and others). Oomph is what produces both the installer and the downloadable packages of Eclipse IDE releases. You can read specifically about Oomph authoring here.
You can use the official eclipse installer. There is an advanced mode to disable the p2 pooling. Then using this mode, everything will go into the eclipse folder. Afterwards you can zip it and give it to others. Of course you are always bound to the CPU Arch still.

Cannot find Eclipse libraries even when specified as dependency

I'm developing part of an Eclipse plug-in. Currently the IDE is saying that packages such as org.eclipse.ui can't be resolved.
I have correctly added org.eclipse.ui to the plugin.xml as dependencies required, as you can see in this picture:
As you can see the packages are listed but have the small red x symbol that indicates that something is wrong. If I try to select one of those names and try to go to declaration and such the IDE cannot find the package.
The IDE I'm using is an Eclipse Neon RCP, freshly installed on my Ubuntu system. AFAICT these packages should come with eclipse itself, if not
how can I install them?
Note I previously used an older Eclipse RCP version to write the code. I'm positive that I did not have to install any special package for development. However I had some other issues and I decided to switch to Neon.
Check the Target Platform is valid (in the 'Preferences' in 'Plug-in Development > Target Platform).
The target platform definitions are part of the workspace and might become invalid when you upgrade.
It is generally a good idea to use a separate target platform rather than the default 'Running Platform' as it gives you more control over which plug-ins are available and is less likely to become invalid during upgrades.

How can I get the "Eclipse >Generate>Jaxb classes" option back?

I recently had to migrate to a new machine and re-installed Eclipse.
At the moment, I need to generate JAXB classes from an xsd. I cannot quite remember what I installed, but in my old Eclipse I had the option -rightclick-generate-jaxb classes.
Who knows what I have to install/plug-in to get it back?
I was looking at installing Dali, which seems like it could be right, but I am pretty sure I did not install Dali last time. I also included the jaxb jars in my build path, as last time, so that should be ok.
I am using Eclipse 3.6 and Java SE 1.6.
If you don't have JavaEE:
Help>>Install New Software>>Works with:--All Available Sites--
Search for JAXB
Then select Web, XML, Java EE and OSGi Enterprise Development and install.
After you restart Eclipse you should see the generate option.
A simple fix for this problem - rather than worrying about adding additional plugins or installs - is to install Eclipse IDE for Java EE Developers rather than Eclipse Classic (both to be found here). This comes with the JAXB support and therefore provides the >Generate>Jaxb classes option.
The above methods may work, but actually the options comes from a plugin called Web Tools Platform which comes along with Eclipse IDE for Java EE Developers.
Don't worry about reinstalling eclipse or try out other methods. No matter what eclipse you use simply install this plugin by following the below procedure. You will get the "JAXB Classes" Option on click of "Generate" button.
Help --> Install New Software --> Add
Name : Web Tools Platform
Location : http://download.eclipse.org/webtools/repository/helios
Hint : In case if you are using a different version replace helios with your eclipse version name. I used it as luna. So the path looks like http://download.eclipse.org/webtools/repository/luna
And restart eclipse. Now you will have that option.
(I'm using IBM's Eclipse-based RAD, so I don't know whether this applies to raw Eclipse.)
Have a look at your project Facets (select project, rightClick->Properties, Project Facets) I have the option of selecting JAX/RS.
later: I've checked my plugins and by default I get Dali installed and it does contain some JAX/B-related stuff. I suspect you do need this.
After a lot of research here is what I have done to fix the issue.
Windows> Preferences> Java> InstalledJREs...make sure to point your jre to the jdk directory. I was pointing to JRE and as soon as I changed it to JDK, it started working.
Hope this will help you guys.
I installed this plugin
http://java.net/downloads/jaxb-workshop/IDE%20plugins/jaxbw-plugin.zip
i.e. unzip and copy to eclipse/plugin folder.
It adds an entry "JAXB 2.1 > Run XJC" to the context menu of *.xsd files.
So the menu's not really in the proper place, but it works.
In order to support the standard JAXB APIs in the IntelliJ IDEA Community Edition environment, you need to make some adjustments. One way to implement JAXB technology is to connect the xjc.exe utility included in the JDK toolkit. This utility can be launched at the command prompt, but it is advisable to configure the context menu:
In the Settings window, select Tools | External Tools and press the
"+" button.
In the Edit Toolbox dialog enter:
the name (Name :) of the new Generate JAXB Classes command;
the path to the xjc.exe utility (Program :), which should be selected on the particular computer in the file selection dialog(button "..." )`
parameters (Parameters :) which in our case will be as follows:
$ p $ FileFQPackage $ $ SourcepathEntry $ $ FilePath $
In order for the created command to work correctly, the schema file should be placed in a new package, which will then appear with the generated files.
In the settings window, Tools | External Tools - "Your command name" will appear.
All you need is to open your schema file and run the command.
you may download JAXB Eclipse Plug-In
jaxb eclipse plugin
I had the same issue while attempting to generate java classes from xsd file.
My installed Eclipse is:
Eclipse Java EE IDE for Web Developers
Version: Oxygen.3a Release (4.7.3a)
Build id: 20180405-1200
I solved it changing the workspace default JRE from JRE to JDK in Project Properties / Java Build Path / Libraries
This link describes how the problem arises:
https://www.youtube.com/watch?v=zgblFjA-5Ks
This link explains how to change the default JRE.
https://www.zkoss.org/wiki/Setting_Default_JRE_In_Eclipse
Hope this helps
If you're using Eclipse EE all you have to do is switch your running environment from JRE to JDK and that should fix it. Windows -> Preference -> Java -> Installed JRE -> Add - > (Choose Standard VM) Then Select JDK!
Then Execution Environments under Installed JRE select your JavaSE-1.8 or your version and also select JDK!

Categories