Mallet Java configuration [Windows] (Ant installation may fail to solve the solution)

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/a19990412/article/details/90755348

Brief

( In general, when you add environment variables: In addition to these we * _HOME Custom (based on their own to put things up which folder), others like me is not the problem )

JAVA configuration

According to the following article first complete Java configuration

Mallet Download

Download ANT

ANT Configuration

  • Add this ANT_HOME variables (mainly in order to facilitate the changes, remember to develop such a good habit)
    Here Insert Picture Description
    here the way configuration is successful

  • New (or add) classpath, here is actually called the variable you created earlier.
    Here Insert Picture Description

  • The key step: add the following in the Path
    Here Insert Picture Description

C:\Users\lijy2>ant
Buildfile: build.xml does not exist!
Build failed

Mallet Configuration

  • ANT is similar to the above, the variable is created out MALLET_HOME
  • The% MALLET_HOME% \ bin added to the Path
  • However, where the classpath, add the following. ( Note that the first semicolon )
;%MALLET_HOME%/class;%MALLET_HOME%/lib;%MALLET_HOME%/lib/mallet-deps.jar

Then, enter the directory Mallet folder, open cmd, powershell or
input ANT , carriage return, you can see the

PS D:\Software\mallet-2.0.8> ant
Buildfile: D:\Software\mallet-2.0.8\build.xml

init:
     [copy] Copying 1 file to D:\Software\mallet-2.0.8\class

compile:
    [javac] D:\Software\mallet-2.0.8\build.xml:61: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

BUILD SUCCESSFUL
Total time: 0 seconds
PS D:\Software\mallet-2.0.8>

but! ! ! !
If you see the following

PS D:\Software\mallet-2.0.8> ant
Buildfile: D:\Software\mallet-2.0.8\build.xml

BUILD FAILED
D:\Software\mallet-2.0.8\build.xml:103: 与元素类型 "check.pytest" 相关联的属性名 "todircheck.pytest" 必须后跟 ' = ' 字符。

Total time: 0 seconds
PS D:\Software\mallet-2.0.8>

Do not worry, this is because build.xml wrong.
From the following github link, directly replace the original copy of the content like a ~

Successful configuration

This is the Document Mallet

Simple test method ( welcome chiefs point out a better way )

The cc file Mallet-2.0.8 / src folders put under your src (java do should know what I mean?)

  • as follows:

Here Insert Picture Description

Then, you can begin to build according to document your code you ~ (I can look after writing java-mallet program, learning)

Guess you like

Origin blog.csdn.net/a19990412/article/details/90755348