Add Java Libraries to a Netbeans Grails Project - java

I am just getting started with Grails. How do I add Java libraries to my Grails project? I added the Smack library jar to the lib folder of my Grails project, but I still cannot import any of its packages into my Java or Groovy classes. I am using the Netbeans IDE. Any help would be appreciated..
Buzzy

This is a know bug in NetBeans: http://www.netbeans.org/issues/show_bug.cgi?id=144243
Maybe you can help the devolpers to fix it by adding a comment to this issue in the NetBeans bug tracker.

Here is what I did to solve the problem when running SpringSource Toolsuite:
Configure the build path by adding external jars (e.g. javax.mail, adwords-api, etc.)
Imported the same jars in to the lib folder (where mysql connector jar is located).
This should fix the compile time errors you would receive from missing imports in your java files.
Hope this helps

As stated above, this is a bug in the IDE, not Grails. Those libraries are available in your code, but the IDE won't do any code completion, etc.
Note, NetBeans 6.5 is supposed to have much better Grails integration. Or, you could use IntelliJ, which already has it.
G2One's acquisition by Spring Source makes the roadmap for Eclipse integration for Grails look much rosier, too. It's not there yet, but it's coming, and now maybe faster than we thought.

The issue still remains in NetBeans 6.5 (Build 200811100001), so the IDE will not do any code completion and formats the code that is referencing classes in the JAR as erroneous.
I have not tried NetBeans 6.7.

I'm using Netbeans 6.7.
I just pasted the library in the project's 'lib' folder and when I went back to Netbeans the library was under the 'Libraries' folder automagically!

i m also using netbean 6.7 and it's automagically working when i passed the jar under Libraries folder

Related

Unable to install org.eclipse.ajdt.ui.nature in Spring Tools 4 / Eclipse

I just downloaded the latest Spring Tools 4 package, 4.3.2 RELEASE. My code base makes widespread use of AspectJ, and every time I try to import a project, I get a "Marketplace solutions available" dialog saying my IDE is missing natures to properly support my projects. It offers org.eclipse.ajdt.ui.ajnature as a solution, but the marketplace won't install it. When I try to access it directly through the Eclipse marketplace in my browser, I get an error dialog saying it's not compatible with this version of Eclipse. I'm using Java 11 on Linux. It's a little hard to figure out which version of Eclipse is embedded in this tool, but it appears to be Eclipse Equinox. Thanks for any help or suggestions.
The link provided by howlger http://download.eclipse.org/tools/ajdt/48/dev/update was the missing piece of information. That solves the problem, everything builds.

Package java desktop app (gradle)

According to this oracle docs there is a conventional java app packaging along with runtime JRE. (Self-Contained Application Packaging)
I know that there is this thing (Launch4j gradle plugin) but I'd prefer to have a bat/sh executables along in the package.
Going through gradle docs and googling I can not seem to find is there is a way to teach gradle to package desktop app with JRE. Is there?
Have you tried this plugin yet?
https://github.com/FibreFoX/javafx-gradle-plugin
This has been a while ago, but if you're still looking for packaging Java desktop apps, have you tried Hydraulic Software's Conveyor?
https://conveyor.hydraulic.dev/
It's a commercial app, but it's free to use for Open Source projects.

Eclipse Imports Ant Build Incorrectly

As someone who is new to Java and developing a plugin for Datameer, I'm not sure if Eclipse has imported the project structure correctly. It doesn't look like it. The nested src folders are split out separately as what looks like Java packages. The Jar files requested by the plugin sdkare not in a lib folder, they're included at the top level of the project.
The project requests Java 1.7. I'm using Eclipse Mars with Java 1.8. Although, I have Java 1.7 on my machine so it should only matter when I go to build. Could you please help point me in the right direction?
I hate posting answers to my own questions but the issue does appear to be resolved after I switched over to Java 1.7 & restarted eclipse. You can have multiple versions of Java by using update-alternatives on Fedora 22. I can't speak to other distributions. Since the project did require Java 1.7 then this outcome makes sense to me

How to open a Apache Maven project on NetBeans 7.0.1

I'm trying to open a project created with Apache Maven in NetBeans, with no success. I followed the directions given by this link: http://wiki.netbeans.org/MavenBestPractices but the Open Project dialog does not recognizes the project in the folder. When I point to the folder that contains the pom.xml file, it shows as if the folder is empty, except for the sub-folders. Apparently Apache Maven is disabled, but I can't find how to enable it.
Could someone point what is the mistake that I'm doing?
please make sure the maven modules are actually installed in your distribution. (Tools/Plugins I believe). And the latest NetBeans version is 7.4, 7.0.1 is fairly old already.
I installed the NetBeans 7.4 from here: http://www.oracle.com/technetwork/java/javase/downloads/jdk-7-netbeans-download-432126.html and it worked! Probably the build from Ubuntu repositories has issues. Thanks for the suggestions!

Download and install JavaFX for Eclipse

I'm an experienced (Java, Eclipse & Maven) developer, and have used a couple of frameworks thus far. Every time I'm trying to start with something new, it seems like there are about a zillion configuration possible for downloading and installing it.
I've looked here for instructions, and all the near pages, but they seem out dated, the Eclipse plugin path is invalid, and when I install the latest version I've found no the site (2.0.2), it says that I have a newer version installed.
Also, the Maven setup in most posts I've read seems obscure.
I'm using:
Windows 7
Eclipse x64 Indigo
JDK x64 1.6.0.24
Maven 3.0.3
And I don't recall installing the JavaFX.
What an I missing? Where can I read about the setup in order to start working with this framework?
JavaFX gets installed if you install the latest JDK 7 from Oracle (co-bundled).
You can find the Eclipse plugin here:
http://efxclipse.org/
If your're interested in Maven builds: I've recently released an initial version of Drombler FX, a modular RCP for JavaFX based on OSGi and Maven (POM-first):
http://puces-blog.blogspot.ch/2012/12/drombler-fx-building-modular-javafx.html
http://wiki.drombler.org/GettingStarted
I did tried efxclipse but it was not enough for me. I have also tried to give the path of javafx jar file to efxclipse
Window->Prefrences->javafx->"The path to javafx jar which is
jfxrt.jar"
. But nothing worked for me I don't know what was going wrong.
Then I just add the jfxrt.jar file to my Library and everything worked fine :-
1. Right click your JRE System Library
2. Build Path
3. Configure Build Path
4. Add External Jars
5. "The path to jfxrt.jar"
You can download jfxrt.jar file from this link.
Or
If you have already downloaded the latest oracle JAVA JDK you will find in this path
Extracted_oracle_jdk_folder/jre/lib/ext/jfxrt.jar
That's it everything should work fine.
Try e(fx)clipse at http://efxclipse.org/. I'm a netbeans developer, but heard a lot of good stuff about that plugin from my eclipse using friends.

Categories