Netbeans there is a way to create an empty project? - java

I 'am a Visual Studio (VB.net / C#) programmer and I have installed Netbeans.
When I open a new project 'Java application' don't create a new EMPTY project but add the project to the other previous projects.
In Visual Studio (and all other IDEs) if I choose 'new project' after I see ONLY my new project and not all projects.
How can I do to create only a new empty project with Netbeans ?
P.S.
I don't want use Eclipse becouse I need a Visual Ide (form in particual) and Netbeans see better for this point.
Thank you !

In Tools-Plugins install Freeform project Extras.
Create
Java Free-form project or
empty Ant-based project or
Skeletal Ant-based project

Right click on the other projects and choose "Close Project"

Use:
File->Project Group->New Group...

There's no explicit form for doing that.
As a workaround you can create a project of any type according what you will want to do (Java, C++, PHP, HTML, etc), and then delete the resources created automatically except "nbproject" folder.
With this approach you have something similar to an empty project.
I recently used this trick for group some modules created for PrestaShop and then push them to Git VCS as if it were a single project, when actually each module is an independent project folder.

Related

How to create a JavaFX Maven project in IntelliJ IDEA?

How can I open a JavaFX Maven project from scratch in IntelliJ IDEA? As there is no difference between a Java project and a JavaFx project, I want to open a dedicated JavaFX project (Selection JavaFX from create project Wizard) with Maven module included.
Although dated I'm answering this because I had the same question recently and too many people told me to write my own pom file etc. While that is technically true, it can create more headaches if you aren't careful.
I recommend you:
Create a JavaFX project as you normally would.
Make sure that project view (dropdown in project structure side tool window) is set to 'Project' or 'Packages' (otherwise option in 4th step will not be visible)
Then once it is opened and ready right click on the project folder
Go to "Add Framework Support...".
Check the box for Maven and click "OK".
Let IntelliJ do the work for you at this point.
As for editing FXML files link the IDEA to SceneBuilder. Here is the official documentation. But basically:
Install Scene Builder.
File -> Settings -> Languages & Frameworks -> JavaFX
Point to the exe file.
To Use: Right click on the FXML file and select "Open In SceneBuilder" (way down at the bottom)
And after all, a program doesn't compiled. So this video helped me: Configuring Maven For Java FX
in words:
we need to move sample.fxml to /resources folder. And in Main.java write:
FXMLLoader loader=new FXMLLoader(getClass().getResource("/sample.fxml"));
This steps worked for me (Is a different process):
1. Create a maven project.
2. In the generated pom.xml add the following:
`<build>
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.7.0</version>
<configuration>
<mainClass>your.package.with.mainclass</mainClass>
</configuration>
</plugin>
</plugins>
</build>`
This adds a maven plugin for javafx (more info: https://github.com/javafx-maven-plugin/javafx-maven-plugin)
Create in your resources folder your sample.fxml
Create your controller class for sample.fxml and link
Enjoy!
It takes me a couple of hours to find the right solution.
Many thanks to this video and the author:
https://www.youtube.com/watch?v=qn2tbftFjno
So, following the above video, I would like to recommend:
Download JavaFX SDK from https://gluonhq.com/products/javafx/
Extract the zip file
From the starting page of Intellij IDEA, select Configure/Structure for New Projects
Select Platform Settings/Global Libraries
Select the plus ("+") button/Java
Find the "lib" folder inside your extracted zip file and select all of ".jar" files (except "src.zip"), and then OK
Set a new name for the library, let's say "javafx-whatever-version", then
Apply/OK
Create a JavaFX project as normally.
Select File/Project Structure...
From Project Settings/Project, remember to select the suitable Project SDK and Project language level
From Platform Settings/Global Libraries, right click on the library "javafx-whatever-version" (which you have already added),
choose Add to modules.../OK
Switch to Project Settings/Modules, choose Apply/OK
Back to your project manager, right click on "src"/New/module-info.java
Add new lines to the body of module-info.java:
requires javafx.fxml;
requires javafx.controls;
opens sample;
Run the project and enjoy!
For anyone coming here. I think the best answer lies on the openjfx docs. It contains a separate section for JavaFX & InteliJ, select the Non modular with Maven section.
Ill describe the steps in breif.
Create new Maven project.
Select create from archtype.
Add new archtype ( groupid : org.openjfx , artifactId : javafx-maven-archetypes , version 0.0.1 )
Select the created archtype and Next.
Provide group id org.openjfx ArtifactId hellojavafx and Next.
Change the property archtypeArtifactId value to javafx-archetype-fxml.
Add new property for javafx version : property javafx-version and value : 14.
Finally give a name to project like HelloJavaFX.
Now click finish and wait for inteliJ to build the project.
Once InteliJ finish its work the pom should look like this sample.
PS :
Two more additional tips you need to follow if you follow this approach to get things going smoothly.
JavaFX 14 needs java 11 or newer.
Change the javax maven plugin version to 0.0.1 to 0.0.4 to avoid errors like invalid flag --module-path.
Also to work better Download and install the
If you have already installed Maven, here is the exact user guide below to create a javafx project:
Open intellij
Create javafx project in folder with other maven projects.
Click on folder (project at the top) in intellij and choose run maven and package.
Then if you need plugins for javafx click again on project folder, run maven, plugins and you choose. I needed: javafx: jlink.

Export wizard application in netbeans

I did a sample application mentioned in this link using Netbeans Wizard template https://platform.netbeans.org/tutorials/nbm-wizard.html
But how do I export as executable jar. I just want to execute the project independently with out IDE. Any suggestions.
I can't find it in the tutorial that you point to but in order to share your newly created Netbeans plugin you need to export it as a binary NetBeans Module or .nbm file. Right click on your project and select Create NBM. Check this old tutorial here: http://docs.huihoo.com/netbeans/6.0/kb/60/platform/nbm-google.html
For Netbeans 8.0: When the file is created you can then go Tools->Plugins , downloaded tab and then click add plugins
EDIT (based on your comments)
The tuturial you point to guides you to build a custom Netbeans module (in this case a Wizard). The module is packaged as a .nbm file which you can then distribute it so that it can be installed to any Netbeans IDE.
As it turns out you need something like a "Java swing wizard" application. By searching google you can find some results that fit your needs (these are from the first google results):
http://www.oracle.com/technetwork/articles/javase/wizard-136789.html
https://code.google.com/p/cjwizard/
http://www.javaworld.com/article/2077850/java-se/open-source-java-projects-the-wizard-api.html
http://sourceforge.net/projects/jwf/
Similar question (maybe you can post a comment asking for details there):
https://softwareengineering.stackexchange.com/questions/132723/is-there-a-java-library-to-create-assisted-wizard-flow-into-your-desktop-applica
Hope I am not leading you to the wrong way but another thing you can also have a look at, (haven't checked it myself but you might find it useful) is how to create OSGI modules and the posibility of converting Netbeans modules to OSGI modules.
Look here: http://wiki.netbeans.org/OSGiAndNetBeans.

Integrate Map/Reducer and Java Project Eclipse

I have a Java Project & Map/Reducer Project in eclipse Workspace, I want to use a class file of Map/Reducer Project from java project to perform computation, I am new to Apache Hadoop & Map/Reducer thing, please Suggest.
If a hadoop project is just like a Java project (and it probably is); right click on the other project in the package explorer, select properties, and then choose java build path. After that, click on the projects tab and select the add button. A dialog box should come up, and you should be able to select your hadoop project.
Both projects must be in the workspace, of course.

Import source java project in Android project

Is it possible to import an existing Java project which is in my workspace, in an Android project which is also in my workspace? The Java project doesn't use stuff that is incompatible with Android. I could do it using a .JAR, but since I'm modifying the Java project a lot, I would like to import the whole source code and change it once in a while. Is it possible? Thanks
This is somewhat of a hack, but worked for my project:
Add both Android project and plain Java project to workspace
Go to properties for Android project -> Java Build Path -> Source
Click Link Source, in "Folder name", make sure to select the root directory of the plain Java project's src tree
Use a descriptive name for "Linked folder location", like "java_project_src".
Press Finish and compile
This setup will compile the plain-java code as Dalvik bytecode. In my case, I had pure java code with very limited dependencies, but wanted to share the pure java code with non-Android projects, instead of separately maintaining these files in every project.
I think you are talking about referencing other projects into the current project, if this is the case then you can do this by Right click on project, properties->Project Reference.
You can link another projects to your current project. Right click on your main project, choose Build Path -> Configure Build Path... In the dialog choose the Projects tab, then click Add.. button. Now choose the project you want to link and click OK. You'll now be able to use this project's sources inside your main project. Hope this helps.

Converting an Eclipse Java project to a Google AppEngine one

I have a project with a large amount of pre-processing. I have written this part and would now like to convert the project to a GAE project.
I have enabled the GAE support in Project->Properties and have some functionality but when I want to testrun the app I get a "Web application archive directory does not exist."
Is there a way to automatically generate the missing folders and files or do I have to do that manually?
I do not want to copy my classes into a newly created project since that would mean loosing all my version control.
I think that with the GAE plugin for Eclipse, you can create a GAE app skeleton. You just have then to move your old project files into this project, and you're done.
For just conversion, I don't know if it's possible, if the structure of your app is completely different from the GAE structure.
As for the error you have, it seems that your app lacks a WEB-INF directory that any webapp needs to run.
I am using GAE Eclipse Plugin 1.2.1 and Eclipse 3.4.2 and I have tried the same operation and have been unsuccessful so far. I believe the eclipse plugin is hardcoded to look for the various components at specific locations. (The right approach would have been to configure the GAE plugin to look for the all the WEB-APP components at other locations than the default.) I would think that given these versions, converting an eclipse project directly wouldn't be possible.
A possible solution, given this constraint, would be create a new GAE project and copy all your existing code into that structure without altering the folders already created by the GAE plugin.
Don't know if this will work for Java -> GAE project conversion, but I've had luck doing something similiar, converting General -> Java projects using the following steps:
Close your project.
Open your project file (which is located in your root directory of the appropriate project) called .project with your default editor. Search for:
<natures>
</natures>
and change it to
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Store the changed file.
Open the project again - now it's a java project.
Of course you'll need to create a new GAE project and then look inside its .project file to get the correct element contents.
I found the above steps googling around, so I can't unfortunately credit the original source of the above instructions.
You CAN convert your existing eclipse projects to GAE projects. All you need to do is right-click the project and choose settings. Then choose Google settings and tick the "use Google App Engine SDK" option.
Using Google Plugin for Eclipse with existing projects
Not sure about the whole GAE specific stuff, but you can copy your old projects contents:
Create new GAE-Project
Close it
Use a file manager outside eclipse to copy all your old projects contents into the new project. Make sure, you include the ".svn" folder, it may be invisible in the explorer/nautilus/whatever. You should also think about leaving the .project file of the new project alone, as it may contain GAE specific configuration.
Open the project in Eclipse again
Right click project -> Team -> Share project -> Select SVN
Your old project URL should be already there, leave the radio button with "Use project settings" checked.
The project connects back to the old repository location, and in sync view you should see the new files as outgoing.
To complete #Marks response, you should add this line to your .project file:
<nature>com.google.appengine.eclipse.core.gaeNature</nature>

Categories

Resources