Netbeans scala javadocs missing in Netbeans 8.0 - java

I've been looking into scala lately and from the conciseness and language features I'm completely thrilled.
I have netbeans 8.0 running on ubuntu 12.04 and downloaded scala, edited netbeans.conf (netbeans_default_options="-J-Dscala.home=...), installed plugins from plugin manager inside netbeans (ALL OF THEM). Then, I created scala project (not maven one) and tried out autocomplete. It works, compiles, runs, however, it shows no document found in autocompletion.
This is how I added javadocs Tools > Scala platforms > javadoc tab
I tried adding following ways:
added the entire scala api doc zip from http://downloads.typesafe.com/scala/2.11.2/scala-docs-2.11.2.zip
extracted the previous zip to scala-home folder under $SCALA_HOME/docs/javadocs/scala-docs-2.11.2 and added that
same as 2 but added $SCALA_HOME/docs/javadocs/scala-docs-2.11.2/api in netbeans
None of these pick up documentation! Of course, I could live without it, but it's such a killer for such a concise language where I could just find out stuff instantly from autocompletion. Also, I don't want to use eclipse special ide for scala because I don't want to throw out all the experience with netbeans out of the window and learn new IDE.
P.S. - Netbeans navigator also seem not to work in scala.
And I wonder why there's so little content on google for such a wonderful language?

There is no need to change to IntelliJ. Use the right build tool -sbt or Maven- and everything works fine.
In Netbeans you can use e.g. free Application Servers.

Netbeans support for scala seems pathetic so I just decided to jump to IntelliJ IDEA. It was little bit of learning curve but I'm glad I did because now everything was working (autocomplete, documentation, awesome SBT support etc. etc.)

Related

JavaFX and IntelliJ no errors althought the documentation says I should have some

I'm currently following this tutorial: https://openjfx.io/openjfx-docs/ (JavaFX and IntelliJ IDEA). I use Intellij 2021.3.2.
I have created a project (1. Create a JavaFX project), which worked out great and didn't need to 2. Set JDK 16 because it was already set to 17 (which I guess is fine).
But here begin the weird stuff (and I'm very new to programming so I'm sorry if it sounds silly). "You can also set the language level to 11 or greater." I don't have this option. Because it's "can" I felt like it wasn't a big deal but if someone can explain what this is all about? Just out of curiosity, because I'm at the very beginning of the tutorial and I kinda only understand half of it.
Then 3. Create a library, and I don't have what they have, and my stuff is red:
So when they said "add the JavaFX 17 SDK as a library to the project" I didn't know what to do. I also didn't know what to do to fix the red stuff.
And finally, they say "Warning: If you run now the project it will compile but you will get this error: ..." but if I click on this button
everything works! which you know i'm not complaining about but I would like to understand a bit more what is happening.
And then they suggest I should 4. Add VM options to fix the problem that I don't have. So I figured maybe my computer set the VM options correctly without me knowing it but there is currently no VM option (and it works). Should I add them nonetheless?
Thank you for your help, I'm very lost and feel like I don't really understand anything.
The current documentation in the openjfx tutorial for getting started with JavaFX using Idea is incorrect, at least for recent Idea releases (2021.3 +).
The tutorial is written as though a new Java project was created, rather than a new JavaFX project. Once a new JavaFX project has been created, most of the rest of the steps in the tutorial are either redundant or wrong.
Step 1, “Create a JavaFX project", does a lot more than just “Create a Java project”, which is why everything else is different from the tutorial.
A better tutorial for getting started with JavaFX with Idea, is the official Idea documentation:
Create a new JavaFX project.
Differences between creating a new Java project and creating a new JavaFX project
The new JavaFX project:
Provides a build script for Maven (pom.xml) or Gradle (build.gradle).
Adds the appropriate dependencies for JavaFX base, graphics, controls and fxml.
Provides an example application and controller code that you can run immediately.
The example project is modular and provides a module-info.java
Because the program is modular and dependencies are downloaded via maven and recognized by the IDE, you don’t need to manually configure VM runtime options for the module path and adding modules.
Idea will recognize the Maven or Gradle projects and automatically synchronize the initial transitive dependent libraries with the Idea project.
There are options in the Idea Maven tool window which will allow you to synchronize further changes to dependent libraries or javadoc and source code in libraries.
Selects a JDK and attaches it to the project, automatically downloading the selected JDK version if not already present.
Sets an appropriate language level for the project.
When you just use the create new Java Project option, it doesn’t do any of those things, so you need to do things manually instead, which is what the rest of that tutorial is about:
Manually download the JDK and configure it in the SDK.
Manually download the JavaFX SDK and add the libraries from it to your project.
Manually configure VM modular arguments.
Manually maintain any other dependencies.
Manually associate javadoc and source code.
Manually write the code for a basic application.
Manually set the project language level.
Doing all this stuff manually is more work and more error prone. The manual work usually leads to a worse outcome and a project that is more difficult to maintain for many people getting started with JavaFX, so I do not recommend it.
Versions
In terms of the versions to use, I recommend using the most recent stable (non-beta) releases of both JDK and JavaFX, regardless of what versions may be referenced in any tutorials you may be using.
You can set JavaFX versions in the Maven file generated by the new JavaFX project wizard, then press the button in the Maven Tool window to synchronize the Maven project with the Idea project.
Language level settings
These are important later on, but pretty irrelevant when just getting started.
The language level settings:
Tell the compiler what version of the java byte code to compile the application to.
Tell the IDE what language syntax rules to enforce and provide help with.
If you use Java 17 only features, the app won’t run on a Java 11 VM.
You can define the settings in Idea manually:
language setting level.
But it is better to set them in the compiler section of the maven project and synchronize the project with Idea, which will also configure the settings in the IDE.
IMO, set it to the most recent stable version and have a requirement that your application be run with that Java version as a minimum (you can enforce that by using jlink or jpackage to bundle the JRE version you choose with your packaged app).

What project files does Visual Studio Code create via its Java extensions?

I give a computer programming course I have written, and I recently switched to recommending Visual Studio Code in the course. We are starting out with the basics, so I just wanted a simple editor. We started learning Git, and one student's repository suddenly had all sorts of cruft in it, including:
.settings/
.vscode/
.classpath
.project
In particular the .settings directory had all sorts of Eclipse settings, such as I would expect to see in an Eclipse project.
The student explained to me that these came from VS Code after installing its Java extensions. But why are the VS Code Java extensions creating Eclipse files? And where is all this documented, so that I can update my lessons with the exact details and avoid this problem in the future?
Thanks in advance.
Simplified the Language Support for Java™ by Red Hat is the headless Eclipse Java IDE integrated into Visual Studio Code via the Language Server Protocol (LSP). See the self-description of the extension:
Provides Java™ language support via Eclipse JDT Language Server, which
utilizes Eclipse JDT, M2Eclipse and Buildship.
Except for .vscode/, the mentioned files are Eclipse Java IDE files.
Because in Eclipse these files are not intended to be edited manually, there is little or no documentation about them (the Java compiler settings in .settings/org.eclipse.jdt.core.prefs are similar to the command line arguments of the Eclipse batch compiler).
For example, the documentation of the Java extension recommends using the Eclipse Java IDE to edit the formatter settings (which are also stored in .settings/org.eclipse.jdt.core.prefs) and concludes:
No it's not an ideal solution, but it should be done only once, unless
you regularly change your formatter settings.

GWT Designer not working with Eclipse 4.2 service release 2?

I'm trying to do this tutorial after having installed Eclipse Juno 4.2 service release 2 (Java EE distribution) und following exactly the GWT installation instructions over here.
However, I neither get the WindowBuilder entry under Preferences, nor is there a WindowBuilder entry in the new projects dialog appearing. What am I doing wrong?
I'm running Ubuntu 12.04.02 LTS on amd64, and I have tried oracle jdk 7u17 and Ubuntu's own jdk6 distribution, but to no avail...
Just tried the same in Win2k3. Exact same result. Google is starting to annoy me. GWT 2.5.1 throws an error when trying one of my simplest projects...
Update: it is working to some extent. Meaning: WindowBuilder does not recognize GWT Designer's installation and offers to install GWT Designer for Eclipse 3.7. The designer toolbar's GWT selection possibilities therefore are not there.
Update: bug filed.
Update: bug was closed as won't fix. They don't care.
They do care. GWT is a magical development environment, under constant evolution.
They have to race with new versions of browsers, Javascript and releases of Eclipse, so sometimes tiny things may not be always documented up to date. The tutorial you are trying to run is made for GWT Designer 2.3, GPE 2.3, Eclipse 3.7 & Java 1.6.
This tutorial works also perfectly well for Juno 4.2 SR2 with a few minor changes:
In step 1, just Create a Web Application Project. You can generate project sample code, make sure that things work and then clean it up and stick with the folder layout.
In step 3, just add a class and make it extend com.google.gwt.user.client.ui.Composite. Add an empty Constructor and then you can open the GWT Designer as always, in order to do the rest. The CSS styleName property has been improved. There are tool-tips to guide you.
PS: My tests were made in Ubuntu12.04-32bit, WinXP-32bit and Win7-64bit with JDK1.7.0_17-32bit and Eclipse-32bit.
In case the designer tab does't show up by default, I noticed that I can get it by right-clicking the .java on the package explorer and selecting 'open with ...' 'WindowBuilder Editor'.

UML Reverse Engineering in Netbeans Broken

My Goal: I want to make a UML diagram out of my java project in Netbeans. I don't really care how it's done particularly, as long as it looks good.
I saw an answer on Stack Overflow about how to reverse engineer a UML diagram based on Java Code in Netbeans. I attempted the solution and I think most of it works except a few problems which make the solution worthless.
Basically, what I'm experiencing is I will implement the step-by-step instructions in that answer to install the UML plugin, and then right click on the project BONotifier (see below) and click "Reverse Engineer" and use it as the source for the UMLProject1 (see below).
However, when I open UMLProject1, nothing appears under the model (as you can see in the image above), there should be over 20 classes in there... What could be wrong? Thanks!
Oh, and the output of the Reverse Engineering Log can be found in this pastie. I think it may have to do with the fact that this plugin is a little older and the project is running jdk 1.7. I tried it on a 1.6 project and experienced the same problems.
I'm totally open to an alternative solution. I've tried eclipse solutions and I'm not happy with them. I'd prefer a Netbeans solution.
There is no plan to support UML in Netbeans past version 7. It appears something happened in the revisions that broke UML support in the OP's version of Netbeans. Also, the original plugin does not support JDK version 1.7, so you need to use version 1.6 and below. So download Netbeans 6.7.1 and it'll work fine.

Java SWT autocomplete for Eclipse

I'm manipulating SWT library for Java with Eclipse. It's cool however something is missing. Eclipse doesn't propose any thing concern SWT, Ctrl-Space seems losing its magic.
I'd like to know if we can add Autocompletation for SWT and Do you know any cool site to learn SWT
Thanks
If you are creating a project that uses SWT, and you'd like to have all the SWT source and Javadoc available while you're coding, you probably want to use the PDE version of Eclipse. This version comes with all of the source and documentation for all of the SWT, JFace, and Eclipse RCP classes, and provides useful functionality if you are ultimately going to create an RCP application or plug-ins for one.
No auto-completion? That's not supposed to happen. Does your project compile? Do you have the swt.jar in your build path? Does the JDK version work with the SWT version?
Anyway if you want all the documentation, completion etc, if you're using IDE Eclipse, you need both swt.jar and swt.zip - the source. Add swt.jar to build path, tie swt.zip for source and build the project. If still doesn't work try Refresh and build again.

Categories

Resources