- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
今天早些时候,我发现自己回答了一个问题,该问题使用了我以前从未使用过的库( Choco 3.3.3 )。当我测试代码以检查其是否有效时,我收到了一个异常 java.lang.NoClassDefFoundError
。为了解决这个问题,我尝试使用他们网站上的早期版本的库。我从他们的 zip 文件之一中提取的源代码编译了我自己的版本(有关构建信息,请参见下文),我什至从 git 下载并编译了它。然而,这些解决方案都不起作用。
使用代码示例 Choco 可以显示完全相同的异常。提供。
import org.chocosolver.solver.Solver;
import org.chocosolver.solver.constraints.IntConstraintFactory;
import org.chocosolver.solver.search.strategy.IntStrategyFactory;
import org.chocosolver.solver.trace.Chatterbox;
import org.chocosolver.solver.variables.IntVar;
import org.chocosolver.solver.variables.VariableFactory;
public class Test {
public static void main(String[] args) {
// 1. Create a Solver
Solver solver = new Solver("my first problem");
// 2. Create variables through the variable factory
IntVar x = VariableFactory.bounded("X", 0, 5, solver);
IntVar y = VariableFactory.bounded("Y", 0, 5, solver);
// 3. Create and post constraints by using constraint factories
solver.post(IntConstraintFactory.arithm(x, "+", y, "<", 5));
// 4. Define the search strategy
solver.set(IntStrategyFactory.lexico_LB(x, y));
// 5. Indicates that all solutions should be print to the console
Chatterbox.showSolutions(solver);
// 6. Launch the resolution process
solver.findSolution();
// 7. Finally, outputs the resolution statistics
Chatterbox.printStatistics(solver);
}
}
有谁能帮我解决这个问题吗?
请参阅下文了解更多信息
异常堆栈
这是我编译并运行代码时输出的内容
C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Stack Overflow\Answers\Choco equation value>javac -cp choco-solver-3.3.3.jar; Test.java
C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Stack Overflow\Answers\Choco equation value>java Test
Exception in thread "main" java.lang.NoClassDefFoundError: org/chocosolver/solver/Solver
at Test.main(Test.java:11)
Caused by: java.lang.ClassNotFoundException: org.chocosolver.solver.Solver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
Maven 构建信息
这是我尝试从源代码构建时输出的内容
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master>mvn clean package -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Choco-3.3.3: an Open-Source Constraint Solver
[INFO] org.choco-solver:choco-solver
[INFO] org.choco-solver:choco-samples
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Choco-3.3.3: an Open-Source Constraint Solver 3.3.3
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ choco ---
[INFO]
[INFO] --- maven-processor-plugin:3.1.0-beta1:process (process) @ choco ---
[INFO]
[INFO] >>> maven-source-plugin:2.4:jar (attach-sources) > generate-sources @ choco >>>
[INFO]
[INFO] --- maven-processor-plugin:3.1.0-beta1:process (process) @ choco ---
[INFO]
[INFO] <<< maven-source-plugin:2.4:jar (attach-sources) < generate-sources @ choco <<<
[INFO]
[INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ choco ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building org.choco-solver:choco-solver 3.3.3
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ choco-solver ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.5.201505241946:prepare-agent (default) @ choco-solver ---
[INFO] argLine set to "-javaagent:C:\\Users\\Daniel\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.7.5.201505241946\\org.jacoco.age
nt-0.7.5.201505241946-runtime.jar=destfile=C:\\Users\\Daniel\\Dropbox\\Programming\\Code\\Notepad++\\Java\\Packages\\Choco\\choco sourc
e\\choco3-master\\choco-solver\\target\\jacoco.exec"
[INFO]
[INFO] --- maven-processor-plugin:3.1.0-beta1:process (process) @ choco-solver ---
[WARNING] No processors specified. Using default discovery mechanism.
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeBoolTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API
and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeDoubleTrail.java:34: warning: sun.misc.Unsafe is internal proprietary AP
I and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeIntTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API a
nd may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeLongTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API
and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.sisu.scanners.index.SisuInde
xAPT6' less than -source '1.8'
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeBoolTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API
and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeDoubleTrail.java:34: warning: sun.misc.Unsafe is internal proprietary AP
I and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeIntTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API a
nd may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeLongTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API
and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: warning: The following options were not recognized by any processor: '[myoption]'
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ choco-solver ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ choco-solver ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 598 source files to C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\
choco-solver\target\classes
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeBoolTrail.java:[34,16] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeIntTrail.java:[34,16] sun.misc.Unsafe is internal proprietary API and may be remove
d in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeDoubleTrail.java:[34,16] sun.misc.Unsafe is internal proprietary API and may be rem
oved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeLongTrail.java:[34,16] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeBoolTrail.java:[46,19] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeBoolTrail.java:[48,43] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeBoolTrail.java:[50,42] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeBoolTrail.java:[99,19] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeBoolTrail.java:[101,31] sun.misc.Unsafe is internal proprietary API and may be remo
ved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeBoolTrail.java:[103,21] sun.misc.Unsafe is internal proprietary API and may be remo
ved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeIntTrail.java:[46,19] sun.misc.Unsafe is internal proprietary API and may be remove
d in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeIntTrail.java:[48,43] sun.misc.Unsafe is internal proprietary API and may be remove
d in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeIntTrail.java:[50,42] sun.misc.Unsafe is internal proprietary API and may be remove
d in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeIntTrail.java:[99,19] sun.misc.Unsafe is internal proprietary API and may be remove
d in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeIntTrail.java:[101,31] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeIntTrail.java:[103,21] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeDoubleTrail.java:[46,19] sun.misc.Unsafe is internal proprietary API and may be rem
oved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeDoubleTrail.java:[48,43] sun.misc.Unsafe is internal proprietary API and may be rem
oved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeDoubleTrail.java:[50,42] sun.misc.Unsafe is internal proprietary API and may be rem
oved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeDoubleTrail.java:[99,19] sun.misc.Unsafe is internal proprietary API and may be rem
oved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeDoubleTrail.java:[101,31] sun.misc.Unsafe is internal proprietary API and may be re
moved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeDoubleTrail.java:[103,21] sun.misc.Unsafe is internal proprietary API and may be re
moved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeLongTrail.java:[46,19] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeLongTrail.java:[48,43] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeLongTrail.java:[50,42] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeLongTrail.java:[99,19] sun.misc.Unsafe is internal proprietary API and may be remov
ed in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeLongTrail.java:[101,31] sun.misc.Unsafe is internal proprietary API and may be remo
ved in a future release
[WARNING] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java
/org/chocosolver/memory/trailing/trail/unsafe/UnsafeLongTrail.java:[103,21] sun.misc.Unsafe is internal proprietary API and may be remo
ved in a future release
[INFO] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java/or
g/chocosolver/solver/search/loop/MoveBinaryDFS.java: Some input files use unchecked or unsafe operations.
[INFO] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/main/java/or
g/chocosolver/solver/search/loop/MoveBinaryDFS.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ choco-solver ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ choco-solver ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 105 source files to C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\
choco-solver\target\test-classes
[INFO] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/test/java/or
g/chocosolver/choco/strategy/StrategyTest.java: Some input files use unchecked or unsafe operations.
[INFO] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-solver/src/test/java/or
g/chocosolver/choco/strategy/StrategyTest.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.18:test (default-test) @ choco-solver ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.5.201505241946:report (report) @ choco-solver ---
[INFO] Skipping JaCoCo execution due to missing execution data file:C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Ch
oco\choco source\choco3-master\choco-solver\target\jacoco.exec
[INFO]
[INFO] --- maven-jar-plugin:2.5:jar (default-jar) @ choco-solver ---
[INFO] Building jar: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\tar
get\choco-solver-3.3.3.jar
[INFO]
[INFO] --- maven-assembly-plugin:2.5.2:single (make-assembly) @ choco-solver ---
[INFO] Reading assembly descriptor: src/assembly/with-dep.xml
[INFO] Building jar: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\tar
get\choco-solver-3.3.3-with-dependencies.jar
[INFO]
[INFO] >>> maven-source-plugin:2.4:jar (attach-sources) > generate-sources @ choco-solver >>>
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.5.201505241946:prepare-agent (default) @ choco-solver ---
[INFO] argLine set to "-javaagent:C:\\Users\\Daniel\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.7.5.201505241946\\org.jacoco.age
nt-0.7.5.201505241946-runtime.jar=destfile=C:\\Users\\Daniel\\Dropbox\\Programming\\Code\\Notepad++\\Java\\Packages\\Choco\\choco sourc
e\\choco3-master\\choco-solver\\target\\jacoco.exec"
[INFO]
[INFO] --- maven-processor-plugin:3.1.0-beta1:process (process) @ choco-solver ---
[WARNING] No processors specified. Using default discovery mechanism.
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeBoolTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API
and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeDoubleTrail.java:34: warning: sun.misc.Unsafe is internal proprietary AP
I and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeIntTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API a
nd may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeLongTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API
and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.sisu.scanners.index.SisuInde
xAPT6' less than -source '1.8'
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeBoolTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API
and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeDoubleTrail.java:34: warning: sun.misc.Unsafe is internal proprietary AP
I and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeIntTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API a
nd may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\sr
c\main\java\org\chocosolver\memory\trailing\trail\unsafe\UnsafeLongTrail.java:34: warning: sun.misc.Unsafe is internal proprietary API
and may be removed in a future release
import sun.misc.Unsafe;
^
[WARNING] diagnostic: warning: The following options were not recognized by any processor: '[myoption]'
[INFO]
[INFO] <<< maven-source-plugin:2.4:jar (attach-sources) < generate-sources @ choco-solver <<<
[INFO]
[INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ choco-solver ---
[INFO] Building jar: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-solver\tar
get\choco-solver-3.3.3-sources.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building org.choco-solver:choco-samples 3.3.3
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ choco-samples ---
[INFO]
[INFO] --- maven-processor-plugin:3.1.0-beta1:process (process) @ choco-samples ---
[WARNING] No processors specified. Using default discovery mechanism.
[WARNING] diagnostic: warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.sisu.scanners.index.SisuInde
xAPT6' less than -source '1.8'
[WARNING] diagnostic: warning: The following options were not recognized by any processor: '[myoption]'
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ choco-samples ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-m
aster\choco-samples\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ choco-samples ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 81 source files to C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\c
hoco-samples\target\classes
[INFO] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-samples/src/main/java/o
rg/chocosolver/samples/AbstractBenchmarking.java: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\c
hoco3-master\choco-samples\src\main\java\org\chocosolver\samples\AbstractBenchmarking.java uses or overrides a deprecated API.
[INFO] /C:/Users/Daniel/Dropbox/Programming/Code/Notepad++/Java/Packages/Choco/choco source/choco3-master/choco-samples/src/main/java/o
rg/chocosolver/samples/AbstractBenchmarking.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ choco-samples ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-m
aster\choco-samples\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ choco-samples ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\c
hoco-samples\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.18:test (default-test) @ choco-samples ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ choco-samples ---
[INFO] Building jar: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-samples\ta
rget\choco-samples-3.3.3.jar
[INFO]
[INFO] >>> maven-source-plugin:2.4:jar (attach-sources) > generate-sources @ choco-samples >>>
[INFO]
[INFO] --- maven-processor-plugin:3.1.0-beta1:process (process) @ choco-samples ---
[WARNING] No processors specified. Using default discovery mechanism.
[WARNING] diagnostic: warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.sisu.scanners.index.SisuInde
xAPT6' less than -source '1.8'
[WARNING] diagnostic: warning: The following options were not recognized by any processor: '[myoption]'
[INFO]
[INFO] <<< maven-source-plugin:2.4:jar (attach-sources) < generate-sources @ choco-samples <<<
[INFO]
[INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ choco-samples ---
[INFO] Building jar: C:\Users\Daniel\Dropbox\Programming\Code\Notepad++\Java\Packages\Choco\choco source\choco3-master\choco-samples\ta
rget\choco-samples-3.3.3-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Choco-3.3.3: an Open-Source Constraint Solver ...... SUCCESS [ 0.967 s]
[INFO] org.choco-solver:choco-solver ...................... SUCCESS [ 31.333 s]
[INFO] org.choco-solver:choco-samples ..................... SUCCESS [ 8.174 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40.617 s
[INFO] Finished at: 2016-01-11T19:21:09+00:00
[INFO] Final Memory: 42M/771M
[INFO] ------------------------------------------------------------------------
最佳答案
您需要将命令行更改为:
java -classpath .;choco-solver-3.3.3.jar Test
即使这样做,您仍然没有拥有所有依赖项:
Exception in thread "main" java.lang.NoClassDefFoundError: gnu/trove/map/hash/TIntObjectHashMap
at org.chocosolver.solver.Solver.<init>(Solver.java:269)
at org.chocosolver.solver.Solver.<init>(Solver.java:296)
at Test.main(Test.java:11)
Caused by: java.lang.ClassNotFoundException: gnu.trove.map.hash.TIntObjectHashMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 3 more
所有依赖项列表:
dk.brics.automaton:automaton:1.11-8
args4j:args4j:2.32
org.javabits.jgrapht:jgrapht-core:0.9.3
net.sf.trove4j:trove4j:3.0.3
com.github.cp-profiler:cpprof-java:1.1.0
org.zeromq:jeromq:0.3.4
com.google.protobuf:protobuf-java:2.6.1
我建议您创建单独的 Maven 项目,将 choco-solver 添加到 pom.xml 并构建 jar 文件。 (Maven会自动下载所有依赖)
<dependency>
<groupId>org.choco-solver</groupId>
<artifactId>choco-solver</artifactId>
<version>3.3.3</version>
</dependency>
关于java - Choco 3.3.3 NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34729510/
我正在编写一个具有以下签名的 Java 方法。 void Logger(Method method, Object[] args); 如果一个方法(例如 ABC() )调用此方法 Logger,它应该
我是 Java 新手。 我的问题是我的 Java 程序找不到我试图用作的图像文件一个 JButton。 (目前这段代码什么也没做,因为我只是得到了想要的外观第一的)。这是我的主课 代码: packag
好的,今天我在接受采访,我已经编写 Java 代码多年了。采访中说“Java 垃圾收集是一个棘手的问题,我有几个 friend 一直在努力弄清楚。你在这方面做得怎么样?”。她是想骗我吗?还是我的一生都
我的 friend 给了我一个谜语让我解开。它是这样的: There are 100 people. Each one of them, in his turn, does the following
如果我将使用 Java 5 代码的应用程序编译成字节码,生成的 .class 文件是否能够在 Java 1.4 下运行? 如果后者可以工作并且我正在尝试在我的 Java 1.4 应用程序中使用 Jav
有关于why Java doesn't support unsigned types的问题以及一些关于处理无符号类型的问题。我做了一些搜索,似乎 Scala 也不支持无符号数据类型。限制是Java和S
我只是想知道在一个 java 版本中生成的字节码是否可以在其他 java 版本上运行 最佳答案 通常,字节码无需修改即可在 较新 版本的 Java 上运行。它不会在旧版本上运行,除非您使用特殊参数 (
我有一个关于在命令提示符下执行 java 程序的基本问题。 在某些机器上我们需要指定 -cp 。 (类路径)同时执行java程序 (test为java文件名与.class文件存在于同一目录下) jav
我已经阅读 StackOverflow 有一段时间了,现在我才鼓起勇气提出问题。我今年 20 岁,目前在我的家乡(罗马尼亚克卢日-纳波卡)就读 IT 大学。足以介绍:D。 基本上,我有一家提供簿记应用
我有 public JSONObject parseXML(String xml) { JSONObject jsonObject = XML.toJSONObject(xml); r
我已经在 Java 中实现了带有动态类型的简单解释语言。不幸的是我遇到了以下问题。测试时如下代码: def main() { def ks = Map[[1, 2]].keySet()
一直提示输入 1 到 10 的数字 - 结果应将 st、rd、th 和 nd 添加到数字中。编写一个程序,提示用户输入 1 到 10 之间的任意整数,然后以序数形式显示该整数并附加后缀。 public
我有这个 DownloadFile.java 并按预期下载该文件: import java.io.*; import java.net.URL; public class DownloadFile {
我想在 GUI 上添加延迟。我放置了 2 个 for 循环,然后重新绘制了一个标签,但这 2 个 for 循环一个接一个地执行,并且标签被重新绘制到最后一个。 我能做什么? for(int i=0;
我正在对对象 Student 的列表项进行一些测试,但是我更喜欢在 java 类对象中创建硬编码列表,然后从那里提取数据,而不是连接到数据库并在结果集中选择记录。然而,自从我这样做以来已经很长时间了,
我知道对象创建分为三个部分: 声明 实例化 初始化 classA{} classB extends classA{} classA obj = new classB(1,1); 实例化 它必须使用
我有兴趣使用 GPRS 构建车辆跟踪系统。但是,我有一些问题要问以前做过此操作的人: GPRS 是最好的技术吗?人们意识到任何问题吗? 我计划使用 Java/Java EE - 有更好的技术吗? 如果
我可以通过递归方法反转数组,例如:数组={1,2,3,4,5} 数组结果={5,4,3,2,1}但我的结果是相同的数组,我不知道为什么,请帮助我。 public class Recursion { p
有这样的标准方式吗? 包括 Java源代码-测试代码- Ant 或 Maven联合单元持续集成(可能是巡航控制)ClearCase 版本控制工具部署到应用服务器 最后我希望有一个自动构建和集成环境。
我什至不知道这是否可能,我非常怀疑它是否可能,但如果可以,您能告诉我怎么做吗?我只是想知道如何从打印机打印一些文本。 有什么想法吗? 最佳答案 这里有更简单的事情。 import javax.swin
我是一名优秀的程序员,十分优秀!