-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjava_conf.txt
291 lines (280 loc) · 15.8 KB
/
java_conf.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
(1)
# JAVA environment settings
export JAVA_HOME=/home/mjh/Public/jdk1.8.0_111
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export MAVEN_HOME=/home/mjh/Documents/app/apache-maven-3.5.0
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$MAVEN_HOME/bin:$PATH
mjh@mjh-Vostro-260:~/Documents/app$ source etc/profile
mjh@mjh-Vostro-260:~/Documents/app$ java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
mjh@mjh-Vostro-260:~/Documents/app$
mjh@mjh-Vostro-260:~/Documents/app$ mvn -v
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /home/mjh/Documents/app/apache-maven-3.5.0
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: /home/mjh/Public/jdk1.8.0_111/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-74-generic", arch: "amd64", family: "unix"
mjh@mjh-Vostro-260:~/Documents/app/eclipse-installer$ ls
artifacts.xml eclipse-inst features p2 readme
configuration eclipse-inst.ini icon.xpm plugins
mjh@mjh-Vostro-260:~/Documents/app/eclipse-installer$ "run eclipse-inst"
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ ls
pom.xml README.md src
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ cat pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.openmessaging</groupId>
<artifactId>open-messaging-demo</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>2.2.1</version>
</dependency>
</dependencies>
<configuration>
<finalName>OpenMessagingDemo</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/resources/package.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ mvn -v
The program 'mvn' can be found in the following packages:
* maven
* maven2
Try: sudo apt-get install <selected package>
# set maven environment
export MAVEN_HOME=/home/mjh/Documents/app/apache-maven-3.5.0
export PATH=$MAVEN_HOME/bin:$PATH
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ source .bashrc
bash: .bashrc: No such file or directory
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ source ~/.bashrc
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ mvn -v
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /home/mjh/Documents/app/apache-maven-3.5.0
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: /home/mjh/Public/jdk1.8.0_111/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-74-generic", arch: "amd64", family: "unix"
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building open-messaging-demo 1.0
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
Downloading: https://repo.maven.apache.org/maven2/junit/junit/4.12/junit-4.12.pom
Downloaded: https://repo.maven.apache.org/maven2/junit/junit/4.12/junit-4.12.pom (24 kB at 65 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.pom (6.7 kB at 20 kB/s)
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar (223 kB at 93 kB/s)
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar (61 kB at 25 kB/s)
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ open-messaging-demo ---
......
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.jar (13 kB at 35 kB/s)
[INFO] Compiling 40 source files to /home/mjh/Documents/code/open-messaging-demo/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/mjh/Documents/code/open-messaging-demo/src/main/java/io/openmessaging/demo/DefaultProducer.java:[12,7] error: DefaultProducer is not abstract and does not override abstract method flush() in Producer
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.963 s
[INFO] Finished at: 2017-05-24T11:26:16+08:00
[INFO] Final Memory: 14M/74M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project open-messaging-demo: Compilation failure
[ERROR] /home/mjh/Documents/code/open-messaging-demo/src/main/java/io/openmessaging/demo/DefaultProducer.java:[12,7] error: DefaultProducer is not abstract and does not override abstract method flush() in Producer
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ ls
pom.xml README.md src target
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo/target$ ls
classes generated-sources
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo/target/classes/io/openmessaging/demo$ ls
ClientOMSException.class DefaultMessageFactory.class MessageStore.class
DefaultBytesMessage.class DefaultPullConsumer.class
DefaultKeyValue.class DemoTester.class
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ mvn clean package -U assembly:assembly -Dmaven.test.skip=true
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2.1/maven-assembly-plugin-2.2.1.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar (226 kB at 525 kB/s)
[INFO] Deleting /home/mjh/Documents/code/open-messaging-demo/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ open-messaging-demo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ open-messaging-demo ---
[INFO] Compiling 40 source files to /home/mjh/Documents/code/open-messaging-demo/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/mjh/Documents/code/open-messaging-demo/src/main/java/io/openmessaging/demo/DefaultProducer.java:[12,7] error: DefaultProducer is not abstract and does not override abstract method flush() in Producer
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping open-messaging-demo
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.417 s
[INFO] Finished at: 2017-05-24T11:32:05+08:00
[INFO] Final Memory: 16M/129M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project open-messaging-demo: Compilation failure
[ERROR] /home/mjh/Documents/code/open-messaging-demo/src/main/java/io/openmessaging/demo/DefaultProducer.java:[12,7] error: DefaultProducer is not abstract and does not override abstract method flush() in Producer
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[INFO] Reading assembly descriptor: src/main/resources/package.xml
[INFO] Copying files to /home/mjh/Documents/code/open-messaging-demo/target/OpenMessagingDemo
[WARNING] Assembly file: /home/mjh/Documents/code/open-messaging-demo/target/OpenMessagingDemo is not a regular file (it may be a directory). It cannot be attached to the project build for installation or deployment.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.892 s
[INFO] Finished at: 2017-05-24T11:49:46+08:00
[INFO] Final Memory: 20M/150M
[INFO] ------------------------------------------------------------------------
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ mvn test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building open-messaging-demo 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ open-messaging-demo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ open-messaging-demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ open-messaging-demo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/mjh/Documents/code/open-messaging-demo/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ open-messaging-demo ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ open-messaging-demo ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.897 s
[INFO] Finished at: 2017-05-24T11:52:45+08:00
[INFO] Final Memory: 14M/93M
[INFO] ------------------------------------------------------------------------
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ java -jar target/open-messaging-demo-1.0.jar openmessage
no main manifest attribute, in target/open-messaging-demo-1.0.jar
mjh@mjh-Vostro-260:~/Documents/code/open-messaging-demo$ java -cp target/open-messaging-demo-1.0.jar io.openmessaging.demo.DemoTester
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/Assert
at io.openmessaging.demo.DemoTester.main(DemoTester.java:77)
Caused by: java.lang.ClassNotFoundException: org.junit.Assert
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
mjh@mjh-Inspiron-5520:~/Documents/code/open-messaging-demo/target$ ls
archive-tmp maven-archiver open-messaging-demo-1.0.jar
classes OpenMessagingDemo test-classes
mjh@mjh-Inspiron-5520:~/Documents/code/open-messaging-demo/target/OpenMessagingDemo/OpenMessagingDemo/lib$ ls
hamcrest-core-1.3.jar junit-4.12.jar open-messaging-demo-1.0.jar
use eclipse to export runnable jar
mjh@mjh-Inspiron-5520:~/Documents/code/tmp/export$ java -jar openmsg-test.jar
Team1 cost:13 ms tps:157 q/ms
Team2 cost:9 ms tps:227 q/ms
mjh@mjh-Vostro-260:~$ ls -a
. Documents .local .ssh
.. Downloads .m2 .swt
.bash_history .eclipse .mozilla Templates
.bash_logout .erlang.cookie Music .thunderbird
.bashrc examples.desktop .oracle_jre_usage .tooling
.byteexec .gconf .p2 Videos
.cache .gitconfig Pictures .viminfo
.codeblocks .gnome .pip .vscode
.codeintel .gnome2 .pki .wireshark
.compiz .gnome2_private .profile .Xauthority
.config .gvfs Public .xsession-errors
.dbus .ICEauthority .pylint.d .xsession-errors.old
Desktop .kingsoft .python_history
.dmrc .lantern .qd
mjh@mjh-Vostro-260:~$ cd .m2
mjh@mjh-Vostro-260:~/.m2$ ls
repository
mjh@mjh-Vostro-260:~/.m2$ cd repository/
mjh@mjh-Vostro-260:~/.m2/repository$ ls
asm commons-beanutils commons-io junit xml-apis
backport-util-concurrent commons-cli commons-lang log4j
classworlds commons-collections commons-logging org
com commons-digester commons-validator oro
mjh@mjh-Vostro-260:~/.m2/repository$