You are not logged in.

#1 2018-08-22 20:14:41

bgth
Member
Registered: 2018-05-21
Posts: 31

[SOLVED] Problems with languagetool community package

Hello together,

I was trying to get the languagetool-server running but failed. The problem is that the languagetool-server.jar and the libraries and class file are stored on different locations, namely /usr/share/java/languagetool and /usr/share/languagetool. That's why I always get the following error

>> java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081
2018-08-22 22:12:22 Not setting up database access, dbDriver is not configured
WARNING: running in HTTP mode, consider using org.languagetool.server.HTTPSServer for encrypted connections
Exception in thread "main" java.lang.NoClassDefFoundError: org/languagetool/language/LanguageIdentifier
	at org.languagetool.server.TextChecker.<init>(TextChecker.java:80)
	at org.languagetool.server.V2TextChecker.<init>(V2TextChecker.java:42)
	at org.languagetool.server.LanguageToolHttpHandler.<init>(LanguageToolHttpHandler.java:65)
	at org.languagetool.server.HTTPServer.<init>(HTTPServer.java:100)
	at org.languagetool.server.HTTPServer.main(HTTPServer.java:140)
Caused by: java.lang.ClassNotFoundException: org.languagetool.language.LanguageIdentifier
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	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)
	... 5 more

Maybe one of you has an idea of what is wrong here. Thank you in advance.

Last edited by bgth (2018-08-23 20:10:23)

Offline

#2 2018-08-23 00:16:31

flortsch
Member
From: Linz, Austria
Registered: 2015-07-21
Posts: 39
Website

Re: [SOLVED] Problems with languagetool community package

The languagetool package provides a CLI tool which you can use to start an HTTP server.
With this, you don't have to mess with the Java classpath yourself and call the right main class.

To start an HTTP server with the default port 8081 simply run the following command:

/usr/bin/languagetool --http

Last edited by flortsch (2018-08-23 00:17:01)

Offline

#3 2018-08-23 14:28:05

bgth
Member
Registered: 2018-05-21
Posts: 31

Re: [SOLVED] Problems with languagetool community package

Hello flortsch,

thank you for your answer. Your solution works very well. The problem is that I want to use the languagetool within TeXstudio. And TeXstudio assumes a path to the languagetool-server.jar file and I am only allowed to add some arguments. And with these arguments I need to handle this. Everythings works well if I just download the languagetool from the official webside and unzip in some folder. In this case everything is stored at one place and so everything is fine. But I would prefer to use pacman to organize updates and so on.

Offline

#4 2018-08-23 15:06:33

flortsch
Member
From: Linz, Austria
Registered: 2015-07-21
Posts: 39
Website

Re: [SOLVED] Problems with languagetool community package

For me, the default parameters in TeXstudio regarding languagetool are working when I use the languagetool package.
So I can perform language checks in TeXstudio without manually starting languagetool over the CLI.

Server-URL: http://localhost:8081/
Java: java
Start LanguageTool if not running: checked
LT-Path: /usr/share/languagetool:/usr/share/java/languagetool/*
LT Arguments: org.languagetool.server.HTTPServer -p 8081

Offline

#5 2018-08-23 20:09:31

bgth
Member
Registered: 2018-05-21
Posts: 31

Re: [SOLVED] Problems with languagetool community package

Thank you. Now everything works fine with your parameter set.

Offline

Board footer

Powered by FluxBB