Back to LanguageTool Homepage - Privacy - Imprint

Standalone version with Netbeans 8.2

We are trying to use Languagetool with a JavaFX 8 application

Our IDE is Netbeans 8.2

We have looked at this tutorial but the steps seem a bit OLD

LINK

The process of checking the spelling in a JavaFX Textarea is the end goal

The first question is the Desktop version compatible with JavaFX 8 ?

Next we have made a jar file with this cmd

jar cfM languages.jar org/META-INF/

Where things get a little confusing from a post here and the LINK post is what jar files

from the Desktop ZIP file in the libs folder do I want in my Netbeans project Libraries folder

We have no idea how to implement the code so a link to implementation would be great OR

comment about the code implementation in the LINK tutorial if you find time

This is a lot to ask of a company that is providing a FREE product that said

Thank You for your consideration of all our questions and requests

Dwight

I don’t know about JavaFX, but you should use Maven or Gradle to handle the dependencies, as documented at http://wiki.languagetool.org/java-api.

dnaber We have followed the directions in this post POST

All seems to be working except we do know how to invoke the languagetool to look at the text in the textarea. So as a follow up to our original question.

How do you get the languagetool to look at the text in the textarea ?

From my prior response we did copy and paste all the JAR files into our Libraries folder in Netbeans 8.2

We would be happy to share this code with LT if you like so others may understand the process for a JavaFX to use LT in the IDE Netbeans 8.2

Thanks for your time
Dwight

dnaber The project is created with Netbeans 8.2 as a JavaFX 8 project so we do not have access to Maven of Gradle in the IDE. If I copy and paste the jar files into my Libraries folder will that provide the support for languagetool to check spelling in English ? LIST OF JAR’s
CMD USED to create JAR jar cfM languages.jar org/META-INF/
languagetool.core.jar
segment.jar
commons-logging.jar
hppc.jar
all the morfologik jars
all the opennlp jars

You might get more help by replying to that post directly (or emailing its author). I think the LT community’s knowledge about JavaFX is very limited…

dnaber thanks for the reply we are trying to use Maven in a JavaFX project with Netbeans 8.2

Here is a screen shot of the project folders. Can you tell me where to put the various JAR files in relationship to these folders. OR can we use the add goals function in Netbeans 8.2 to install the necessary JAR files. We see various Stack Overflow questions for LT where people give up on installing.

Thank You for your time

PS the author of the tutorial we tried to follow has no contact information

maven

dnaber We are still struggling with LT

We used this process to create three JAR files from the down loaded LT zip file

cd C:\Users\Dwight\Documents\A A A A A LT UnZip\LanguageTool-4.7\LanguageTool-4.7

jar cf languagesLIBS.jar libs/*

jar cf languagesORG.jar org/*

jar cf languagesMETA.jar META-INF/*

Then in Netbeans 8.2 we used this process to place the JAR files in the Dependencies folder

Here is where it gets odd to our limited knowledge of adding Dependencies to Netbeans

  1. Open the Projects tab.
  2. Right-click on Dependencies .
  3. Select Add dependency .
  4. Set groupId to: language(can be anything)
  5. Set artifactId to: en (can be anything)
  6. Set version to: 4.7(can be anything)
  7. Click Add to continue.

Dependency is added to pom.xml and appears under the Libraries node of Maven project. Continue:

  1. Expand Dependencies .
  2. Right-click on library (e.g., group.id ).
  3. Select Manually install artifact .
  4. Set Artifact to install with the Java Archive (.jar) file path.
  5. Click Install locally .

When we do a Clean and Build on the project we get these Warnings

The POM for languagetool:LIBS:jar:4.7 is missing, no dependency information available

The POM for languagetool:ORG:jar:4.7 is missing, no dependency information available

The POM for languagetool:META:jar:4.7 is missing, no dependency information available

We have made the call to JLanguageTool thread safe with this code

static JLanguageTool langTool;

private static void ini(){<br>
  new Thread(() -> {<br>
      langTool = new JLanguageTool(new AmericanEnglish());<br>
  }).start(); <br>
}<br>

This call to the ini() method produces this error

Exception in thread “Thread-4” java.lang.NoClassDefFoundError: com/google/common/cache/CacheLoader

at com.mycompany.maventest.CheckSpellController.lambda$ini$0(CheckSpellController.java:43)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.ClassNotFoundException: com.google.common.cache.CacheLoader

at java.net.URLClassLoader.findClass(URLClassLoader.java:382)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357),br>

Netbeans thinks the files in question are here SEE IMPORTS

import org.languagetool.JLanguageTool;
import org.languagetool.language.AmericanEnglish;
import org.languagetool.rules.RuleMatch;

When we look in the created JAR files in the Dependencies folder we can not find

JLanguageTool nor can we find RuleMatch

QUESTION Why does Netbeans think these are in the location the import code imported from?

Also when we search for LT we only find 4.6 version see screen shot

We do find 4.7 as local when search for org.languagetool:languagetool-core


We are trying to make this work and realize you have other work but it is not as if

we are asking for you to write the code

Thanks for your time

Dwight

Sorry, I know nothing about Netbeans and cannot help with it. I can only recommend to leave dependency handling to Maven or Gradle.

If anyone wanders by here is a link to the correct way to add the LT JAR files to Netbeans 8.2

We still have this error

Exception in thread “Thread-4” java.lang.NoClassDefFoundError: com/google/common/cache/CacheLoader

at com.mycompany.maventest.CheckSpellController.lambda$ini$0(CheckSpellController.java:43)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.ClassNotFoundException: com.google.common.cache.CacheLoader

at java.net.URLClassLoader.findClass(URLClassLoader.java:382)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Feel free to comment on SO we will continue to pursue a solution and post here or on SO

If we find a FIX

LINK to SO