Netbeans 8.1, Angular 2: Cannot find module 'angular2/core', base project created with Angular-CLI - netbeans

Since Netbeans is used as my primary editor, and the project is built with angular-cli, this is a cosmetic issue, the project builds and deploys fine using ng serve -o, this is just an annoyance as I like my Netbeans to flag errors in files that actually have errors.
This is a Netbeans specific question, there are many "Cannot find module 'angular2/core'" questions but each requires different IDE configuration (VS, Webstorm, etc) I have not found one that addressed this issue in Netbeans.
To recreate the issue:
(using angular-cli)
ng new example-of-problem
Then opening example-of-problem in Netbeans:
As you can see from the above, a number of files have errors. All of which are resolving paths starting with '#angular' you can see it can resolve local paths fine (./app.component).
Some solutions request adding: "moduleResuolution":"node" to tsconfig.json however this is a standard angular-cli build and that line is of course present.
Versions of software:
Netbeans 8.1, Node 7.7.4, #angular/cli 1.0.0

The solution is to simply upgrade to netbeans 8.2. The typescript support has been fixed and the lines which are flagged above are no longer flagged.
Netbeans should automatically install the TypeScript Editor plugin, and as a matter of convenience install the netbeans-angular2-code-templates plugin.

Related

Problems creating a project with CodenameOne in Netbeans

Install Netbeans 12.6 on a Windows 10 machine. I was able to install the CodenameOne plugin with no problem. When creating a project I get the following error message:
Cannot invoke "org.openide.filesystems.FileObject.getFileObject(String)" because "folder" is null
I've been surfing the internet and can't find a way to fix it.
Thank you for your support.
This approach is no longer supported. The plugin is only used for legacy applications and no longer works in newer IDEs due to breaking changes in almost all IDEs.
Starting with Codename One 7.x we moved to maven projects which don't require the plugin and can be created in https://start.codenameone.com/
I have followed the instructions in the manual and it mentions as important:
"Before opening the project in NetBeans, you need to copy the contents of the tools/netbeans directory into the root project directory. These files are required by NetBeans to build, run, and debug the project correctly. "
But I can't find this folder in netbeans version 12.6.

Update Eclipse plugin from 2.x style to 4.x style (plugin.xml to manifest.mf/osgi bundle)

I have an Eclipse plugin that was originally written (not by me, and I don't have access to the original developer) that I'm trying to update for Eclipse Luna, because it stopped working when my team updated to Eclipse 4.4.
I downloaded the Luna Plugin development version, cleared a few warnings, updated some broken code, fixed a few bugs, and tested with "Run As -> Eclipse Application
This worked fine: all the views showed up, the preferences pages, etc.
So then I tried to export the plugin so I could test on a fresh installation of vanilla Eclipse Luna. I did that by using the Export Wizard:
And generated a deployable set of jars with said wizard:
I copied the generated folder (which contains all the jars appropriately) into the dropins folder of my fresh vanilla Eclipse Luna and started it up.
Unfortunately, I got the following error:
Which led me to this SO question and this Eclipse bug report, which explains that I have a 2.x style plugin that uses the plugin.xml instead of an OSGi style manifest.mf. Continuing my search, I found this SO question, which was directed at a 3.x version of Eclipse, but I used the 4.x equivalent:
Which I used with the following options checked:
And I accepted all the changes in the previous pane after the (long-running) changeset. However, upon deploying to my vanilla install, I got the same error about the plugin converter. That led me back to this SO question, which recommending installing the Eclipse 2.0 plugin support package. I did so and restarted Eclipse. The error in my error log did stop showing up, however the view/preferences/etc for my plugin are still not showing up. The plugin does show up under Help -> Installation Details -> Plug-ins, but doesn't seem to be interacting at all.
The text of the plugin.xml can be found here at Pastebin. The text of the MANIFEST.MF can by found at this other Pastebin link
Any suggestions for getting my plugin to work through the manual export so the other developers on my team can test my changes before I try releasing the update to the world?

Bundle 'org.eclipse.core.runtime' cannot be resolved

I recently upgraded from Eclipse Kepler to Luna. A plugin I had been working on is now showing build errors without any source being changed.
Here is an extract from my MANIFEST.MF,
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
org.eclipse.core.resources;bundle-version="3.7.0",
org.eclipse.ui.forms;bundle-version="3.6.0",
org.eclipse.wst.sse.ui;bundle-version="1.3.0",
org.eclipse.jface.text;bundle-version="3.8.100",
org.eclipse.ui.workbench.texteditor;bundle-version="3.8.101",
org.eclipse.ui.views;bundle-version="3.6.0"
None of the core or ui bundles are resolved. I don't think Eclipse could even run without them and their equivalent .jar files are present and readable and haven't been modified as part of the upgrade, so they are not actually missing. When I try to add dependencies on the Dependencies tab the problem bundles do not show.
Eclipse was upgraded by the Arch Linux package manager. I mention it for completeness but believe it is likely identical to any other upgrade mechanism. I also tried creating a new plug-in project but the same happens, I guess this means it's a global setting. I'm relatively new to PDE and so far haven't had a need to change any settings.
From the preference page (Preferences > Plug-in Development > Target Platform), try Removing the Running Platform target definition, Applying, and then Restoring Defaults. Maybe it's just stale and pointing to the jars that it doesn't know Arch has changed about.

Platform-specific dependency creeping into Eclipse plugin

I have implemented a graph editor with Eclipse EMF and GMF frameworks. After completing my project, I realized that this plugin shows dependencies (not explicitly added by me) on some OS-specific plugins.i.e:org.eclipse.ui.win32, org.eclipse.swt.win32.win32.x86. And whenever I have tried to bypass this dependency at my update site something went wrong with the installation process of the plugin.
As such it is impossible to run my plugin in *nix environment or even win64 machines.This seems a very heavy constraint dependency to me. Am I doing something in a wrong way? Or is there no other way of building Eclipse plugins which are cross-platform other than building the project from scratch at each different OSs?
We created a similar style of plug-in in my project. Under "Plug-in Dependencies" in Package Explorer I can see org.eclipse.swt.win32 listed, but it is not listed in required plug-ins in plugin.xml.
We also successfully created an update site which works for Mac users without issue.
So, yes it is possible to have a cross-platform plug-in.
I would suggest you first try to to use "Export..." -> "Deployable plug-ins and fragments" to create a bunch of jar files for your plug-in. See if these can be successfully installed by copying into the drop-ins folder of a fresh eclipse installation. Do this first on a Win32 install, then try on another platform. Once you have that working, use the new Eclipse installation to create the Update site.

Failure creating clojure project in Netbeans

I decided to take a look at Clojure and thought the best and easiest method for me would be to use Netbeans with the Enclojure plugin as I didn't want to have to learn Emacs at the same time. I installed Netbeans 6.9.1 together with the latest JDK using the bundled install (on Windows 7). All went smoothly. I then followed the instructions at http://www.enclojure.org/gettingstarted for installing the enclojure plugin.
When creating a new Clojure application I get the following and see no project files :
java.io.IOException: Could not connect to URL nbresloc:/org/enclojure/ide/templates/project/ClojureProjectTemplate-1.1-distribution.zip. No such resource was found.
Maven is working using mvn --version
I have installed on both Windows 7 and Ubuntu 10.04 (same result).
I have looked on the Enclojure forum and there is a recent open thread for this issue, but it is not solved by anybody presently.
I have Java SE enabled in Netbeans
I have tried enabling the different platform versions of Clojure, 1.0.0, 1.1.0, etc..
The REPL seems to be working happily in Netbeans : (printf "hello") hellonill
I did try ClojureBox on Windows 7, but again that's Emacs, but emacs failed to start the server and hung there and became totally unresponsive.
I come from a .Net background (not Java) so my knowledge of the Java environment is somewhat lacking. My reason for looking at Clojure and not Java.
I am new to Netbeans
If you're interested in a working Maven pom, here is one I've used with Enclojure successfully:
http://puredanger.com/techfiles/100624/pom.xml
There are some project settings you'll need to change and a few dependencies to remove but it might be a good start. In general, I usually create the pom first and then just import the project into NetBeans rather than using the NetBeans options to create projects.
By the way, the REPL work in Enclojure has been split and is coming soon to the Eclipse plugin Counterclockwise.
I had written a small post on it on my blog.
Anyways here is the procedure:
On searching realized that this is a common problem for installing it on > Netbeans 7.. But with some manual tweeks managed to install it. Here are the instructions to install on Netbeans 7. plus:
Install Netbeans 7. You need only the Java SE version.
First Run of Netbeans after installation. Activate feature Java SE
Activate features is on the Start page or from Tools,->Plugins>Installed, click ‘Activate next to the Java SE support
Install Maven: It is HIGHLY recommended that you install maven: http://maven.apache.org/download.html
Go to the Netbeans->Preferences, click on the Miscellaneous tab and make sure the External Maven Home path is pointed to your maven install
Download the EnClojure 1.5 version from here. If you want to manually build, you can do that by following the instructions from here.
After downloading the file, In Netbeans: Goto:- Tools ->Plugins->Downloaded->Add Plugins->Downloaded
Then browse to the downloaded file. Later install by clicking at the “install : button.
Restart and you are on the go.
Visit here to build and run hello world project.Basically building the EnClojure 1.5 manually is the tough job. I hope above was useful.