author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 22 Feb 2016 12:41:52 +0200 | |
changeset 1903 | 901e7394849f |
parent 1848 | 17256527f85e |
child 1905 | fba288d59662 |
permissions | -rw-r--r-- |
1213 | 1 |
.. -*- coding: utf-8; -*- |
1334
9bf0d5a1f0cf
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1270
diff
changeset
|
2 |
.. include:: HEADER.rst |
1213 | 3 |
|
4 |
================ |
|
5 |
Java language. |
|
6 |
================ |
|
1346
a2fbf50a43f4
Fix: Has no 'contents::' directive.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
7 |
.. contents:: |
1213 | 8 |
|
9 |
Class version. |
|
10 |
============== |
|
11 |
||
1216 | 12 |
========= ====== ===================== |
13 |
major minor Java platform version |
|
14 |
========= ====== ===================== |
|
15 |
45 0x27 3 1.0 |
|
16 |
45 0x27 3 1.1 |
|
17 |
46 0x28 0 1.2 |
|
18 |
47 0x29 0 1.3 |
|
19 |
48 0x30 0 1.4 |
|
1677
3d2d4e6062f3
New Java byte code versions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1655
diff
changeset
|
20 |
49 0x31 0 5.0 |
3d2d4e6062f3
New Java byte code versions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1655
diff
changeset
|
21 |
50 0x32 0 6.0 |
3d2d4e6062f3
New Java byte code versions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1655
diff
changeset
|
22 |
51 0x33 0 7 |
3d2d4e6062f3
New Java byte code versions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1655
diff
changeset
|
23 |
52 0x34 0 8 |
1216 | 24 |
========= ====== ===================== |
1213 | 25 |
|
1216 | 26 |
where ``minor`` and ``major`` are value of 6 and 8 bytes in .class file:: |
27 |
||
28 |
0xCA, 0xFE, 0xBA, 0xBE, 0x00, minor, 0x00, major |
|
1213 | 29 |
|
30 |
Access modifiers. |
|
31 |
================= |
|
32 |
||
33 |
Public. |
|
34 |
------- |
|
35 |
||
36 |
* Public class is visible in other packages. |
|
37 |
* Public field is visible everywhere (class must be public too). |
|
38 |
||
39 |
Private. |
|
40 |
-------- |
|
41 |
||
42 |
* Private variables or methods may be used only by an instance of the same |
|
1216 | 43 |
class that declares the variable or method |
1213 | 44 |
* A private feature may only be accessed by the class that owns the feature. |
45 |
||
46 |
Protected. |
|
47 |
---------- |
|
48 |
||
49 |
* Is available to all classes in the same package and also available to all |
|
1216 | 50 |
subclasses of the class that owns the protected feature. |
1213 | 51 |
* This access is provided even to subclasses that reside in a different |
1216 | 52 |
package from the class that owns the protected feature. |
1213 | 53 |
|
54 |
default. |
|
55 |
-------- |
|
56 |
||
57 |
What you get by default ie, without any access modifier. |
|
58 |
||
59 |
* It means that it is visible to all within a particular package. |
|
60 |
||
61 |
static. |
|
62 |
------- |
|
63 |
||
64 |
* Static means one per class, not one for each object no matter how many |
|
65 |
instance of a class might exist. This means that you can use them without |
|
66 |
creating an instance of a class. |
|
67 |
* Static methods are implicitly final, because overriding is done based on |
|
68 |
the type of the object, and static methods are attached to a class, not an |
|
69 |
object. |
|
70 |
* A static method in a superclass can be shadowed by another static method in |
|
71 |
a subclass, as long as the original method was not declared final. |
|
72 |
* You can't override a static method with a nonstatic method. |
|
73 |
||
74 |
final. |
|
75 |
------ |
|
76 |
||
77 |
* A final class can't be extended ie., final class may not be subclassed. |
|
78 |
* A final method can't be overridden when its class is inherited. |
|
79 |
* You can't change value of a final variable. |
|
80 |
||
81 |
Exceptions. |
|
82 |
=========== |
|
83 |
||
84 |
A checked exception is some subclass of Exception (or Exception itself), |
|
85 |
excluding class RuntimeException and its subclasses. |
|
86 |
||
87 |
Unchecked exceptions are RuntimeException and any of its subclasses. Class |
|
88 |
Error and its subclasses also are unchecked. With an unchecked exception, |
|
89 |
however, the compiler doesn't force client programmers either to catch the |
|
90 |
exception or declare it in a throws clause. |
|
91 |
||
92 |
Inner classes. |
|
93 |
============== |
|
94 |
||
95 |
Nested top-level classes. |
|
96 |
------------------------- |
|
97 |
||
98 |
If you declare a class within a class and specify the static modifier, the |
|
99 |
compiler treats the class just like any other top-level class. |
|
100 |
||
101 |
Any class outside the declaring class accesses the nested class with the |
|
102 |
declaring class name acting similarly to a package. eg, outer.inner. Top-level |
|
103 |
inner classes implicitly have access only to static variables. There can also |
|
104 |
be inner interfaces. All of these are of the nested top-level variety. |
|
105 |
||
106 |
Member classes. |
|
107 |
--------------- |
|
108 |
||
109 |
Member inner classes are just like other member methods and member variables |
|
110 |
and access to the member class is restricted, just like methods and variables. |
|
111 |
This means a public member class acts similarly to a nested top-level class. |
|
112 |
||
113 |
The primary difference between member classes and nested top-level classes is |
|
114 |
that member classes have access to the specific instance of the enclosing |
|
115 |
class. |
|
116 |
||
117 |
Local classes. |
|
118 |
-------------- |
|
119 |
||
120 |
Local classes are like local variables, specific to a block of code. Their |
|
121 |
visibility is only within the block of their declaration. In order for the |
|
122 |
class to be useful beyond the declaration block, it would need to implement a |
|
123 |
more publicly available interface. |
|
124 |
||
125 |
Because local classes are not members, the modifiers public, protected, |
|
126 |
private, and static are not usable. |
|
127 |
||
128 |
Anonymous classes. |
|
129 |
------------------ |
|
130 |
||
131 |
Anonymous inner classes extend local inner classes one level further. As |
|
132 |
anonymous classes have no name, you cannot provide a constructor. |
|
133 |
||
134 |
64-bit problem. |
|
135 |
=============== |
|
136 |
||
137 |
http://www.java.com/en/download/faq/java_win64bit.xml |
|
138 |
Which version of Java should I download for my 64-bit Windows |
|
139 |
operating system? |
|
140 |
http://java.sun.com/javase/6/webnotes/install/system-configurations.html |
|
141 |
Java SE 6 Release Notes Supported System Configurations |
|
142 |
||
143 |
Java performance. |
|
144 |
================= |
|
145 |
||
146 |
http://java.sun.com/performance/reference/whitepapers/5.0_performance.html |
|
147 |
http://java.sun.com/performance/reference/whitepapers/6_performance.html |
|
148 |
||
149 |
Creating jar. |
|
150 |
============= |
|
151 |
:: |
|
152 |
||
153 |
$ jar cf myFile.jar *.class |
|
154 |
$ jar cmf myManifestFile myFile.jar *.class |
|
155 |
$ jar -cfe Main.jar foo.Main foo/Main.class |
|
156 |
||
1215 | 157 |
Profiling Java. |
1213 | 158 |
=============== |
159 |
:: |
|
160 |
||
161 |
$ java -Xprof com.vendor.product.Clazz |
|
1214
fe28cec0bb40
java -Xrunhprof:help
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1213
diff
changeset
|
162 |
$ java -Xrunhprof:help |
1213 | 163 |
|
1215 | 164 |
Debugging Java. |
165 |
=============== |
|
166 |
||
167 |
Compile with ``-g`` to preserve source code information:: |
|
168 |
||
169 |
$ javac -g -cp $CLASSPATH -sourcepath $SRC_DIR -d $BUILD_DIR |
|
170 |
||
171 |
To run Java program in debugger:: |
|
172 |
||
173 |
$ jdb -cp $CLASSPATH -sourcepath $SRC_DIR |
|
174 |
||
1238
53da16ba1897
-Xrunjdwp:transport
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1216
diff
changeset
|
175 |
To attach to Java application you firstly must run application with (use |
53da16ba1897
-Xrunjdwp:transport
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1216
diff
changeset
|
176 |
``dt_shmem`` for Windows and ``dt_socket`` for Linux):: |
1215 | 177 |
|
178 |
$ java -Xdebug -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=$PORT \ |
|
179 |
com.vendor.product.Clazz |
|
180 |
||
181 |
and then attach with debugger:: |
|
182 |
||
183 |
$ jdb -attach $PORT |
|
184 |
||
1848
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
185 |
Creating thread dump. |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
186 |
===================== |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
187 |
|
1629
32f8c509119d
Dump current thread traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1563
diff
changeset
|
188 |
Dump current thread traces and memory statistic to stdout:: |
32f8c509119d
Dump current thread traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1563
diff
changeset
|
189 |
|
32f8c509119d
Dump current thread traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1563
diff
changeset
|
190 |
$ kill -QUIT $PID |
32f8c509119d
Dump current thread traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1563
diff
changeset
|
191 |
|
1848
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
192 |
If application started with ``nohup`` redirect output to selected file:: |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
193 |
|
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
194 |
$ nohup java -cp ... com.app.Main >$NOHUP.log & |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
195 |
|
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
196 |
or check default ``nohup.out`` or ``$HOME/nohup.out`` file. |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
197 |
|
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
198 |
Alternatively use ``jstack`` utility for Java version 1.5 and above:: |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
199 |
|
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
200 |
$ jstack -l $PID >$DUMP.out |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
201 |
|
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
202 |
``jstack`` should be runned from same user as probing application:: |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
203 |
|
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
204 |
$ sudo -u $USER jstack -l $PID >$DUMP.out |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
205 |
|
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
206 |
.. NOTE:: Thread information preserved in heap dump and can be reviewed in |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
207 |
``visualvm``. |
17256527f85e
Creating thread dump.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1847
diff
changeset
|
208 |
|
1845
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
209 |
Creating heap dump from Java application. |
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
210 |
========================================= |
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
211 |
|
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
212 |
Find pid of Java process:: |
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
213 |
|
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
214 |
$ jps -l -v |
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
215 |
|
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
216 |
Save dump to file:: |
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
217 |
|
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
218 |
$ jmap -dump:format=b,file=heap.dump $PID |
3004b10986a1
Creating heap dump from Java application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1833
diff
changeset
|
219 |
|
1847 | 220 |
With ``live`` option only reachable objects are dumped:: |
221 |
||
222 |
$ jmap -dump:live,format=b,file=heap.dump $PID |
|
223 |
||
1846
a2bec9594bb4
Creating heap dump on OutOfMemory error.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1845
diff
changeset
|
224 |
Creating heap dump on OutOfMemory error. |
a2bec9594bb4
Creating heap dump on OutOfMemory error.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1845
diff
changeset
|
225 |
======================================== |
a2bec9594bb4
Creating heap dump on OutOfMemory error.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1845
diff
changeset
|
226 |
|
a2bec9594bb4
Creating heap dump on OutOfMemory error.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1845
diff
changeset
|
227 |
Run Java application with:: |
a2bec9594bb4
Creating heap dump on OutOfMemory error.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1845
diff
changeset
|
228 |
|
a2bec9594bb4
Creating heap dump on OutOfMemory error.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1845
diff
changeset
|
229 |
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/path/to/heap.dump |
a2bec9594bb4
Creating heap dump on OutOfMemory error.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1845
diff
changeset
|
230 |
|
1643
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
231 |
Debug class loading. |
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
232 |
==================== |
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
233 |
|
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
234 |
To dump class loading and unloading to ``System.out`` add to ``java`` opts:: |
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
235 |
|
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
236 |
$ java -XX:+TraceClassLoading -XX:+TraceClassUnloading ... |
1644 | 237 |
$ java -verbose:class ... |
1643
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
238 |
|
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
239 |
To review loaded classes explore heap dump in ``visualvm`` (visit "Classes" |
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
240 |
tab). |
fed98aef5cae
Debug class loading.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1629
diff
changeset
|
241 |
|
1687
da4a6ceb7e89
Decompile class file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1686
diff
changeset
|
242 |
Decompile class file. |
da4a6ceb7e89
Decompile class file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1686
diff
changeset
|
243 |
===================== |
da4a6ceb7e89
Decompile class file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1686
diff
changeset
|
244 |
:: |
da4a6ceb7e89
Decompile class file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1686
diff
changeset
|
245 |
|
da4a6ceb7e89
Decompile class file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1686
diff
changeset
|
246 |
$ javap -v -p -c My.java |
da4a6ceb7e89
Decompile class file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1686
diff
changeset
|
247 |
|
1269 | 248 |
Find jar by class. |
249 |
================== |
|
250 |
||
1270
af6cbb1b5888
http://mvnrepository.com/search.html?query=PKG
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1269
diff
changeset
|
251 |
http://mvnrepository.com/search.html?query=PKG |
1269 | 252 |
http://www.jarfinder.com |
253 |
||
1686
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
254 |
Set default Java in Debian. |
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
255 |
=========================== |
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
256 |
:: |
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
257 |
|
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
258 |
$ update-java-alternatives -l |
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
259 |
$ sudo update-java-alternatives -s java-1.8.0-openjdk-i386 |
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
260 |
|
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
261 |
or individually for each executable:: |
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
262 |
|
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
263 |
$ sudo update-alternatives --config java |
4ea7c87dfb87
Set default Java in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1677
diff
changeset
|
264 |
|
1655
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
265 |
Import SSL certificate. |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
266 |
======================= |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
267 |
|
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
268 |
Get cert with:: |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
269 |
|
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
270 |
$ openssl s_client -connect promin-test.it.loc:433 |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
271 |
|
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
272 |
-----BEGIN CERTIFICATE----- |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
273 |
... |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
274 |
-----END CERTIFICATE----- |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
275 |
|
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
276 |
or by opening URL in broswer and exporting in "Page info" ==> "Security" menu. |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
277 |
|
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
278 |
Call import utility with default ``changeit`` password:: |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
279 |
|
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
280 |
$ keytool -importcert -file $YOUR.crt -keystore $JAVA_HOME/jre/lib/security/cacert -alias $ANY -storepass changeit |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
281 |
$ keytool -list -v -keystore $JAVA_HOME/jre/lib/security/cacert -storepass changeit |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
282 |
|
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
283 |
Import certificate system wide in Debian by (note, ``.crt`` extention is |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
284 |
mandatory):: |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
285 |
|
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
286 |
$ sudo mkdir /usr/share/ca-certificates/$ANY/ # don't mess with other certs |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
287 |
$ sudo cp /tmp/$YOUR.crt /usr/share/ca-certificates/$ANY/ |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
288 |
$ sudo dpkg-reconfigure --force ca-certificates # check your cert in curses GUI! |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
289 |
$ sudo update-ca-certificates --fresh --verbose |
1cabdf6fe296
Import SSL certificate.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1644
diff
changeset
|
290 |
|
1379 | 291 |
Java EE versions. |
292 |
================= |
|
293 |
||
294 |
======= ======== ======== ======== |
|
295 |
Java EE Servlet JSP JSTL |
|
296 |
======= ======== ======== ======== |
|
297 |
6 3.0 2.2 - |
|
298 |
5 2.5 2.1 1.2 |
|
299 |
1.4 2.4 2.0 1.1 |
|
300 |
1.2 2.3 1.2 1.0 |
|
301 |
======= ======== ======== ======== |
|
302 |
||
1380 | 303 |
To set servlet version check ``WEB-INF/web.xml``:: |
1379 | 304 |
|
305 |
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"> |
|
306 |
||
307 |
See: |
|
308 |
||
1833
378b566fd86b
Java EE version history
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1687
diff
changeset
|
309 |
http://en.wikipedia.org/wiki/Java_EE_version_history |
378b566fd86b
Java EE version history
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1687
diff
changeset
|
310 |
Java EE version history. |
1379 | 311 |
http://jcp.org/aboutJava/communityprocess/final/jsr315/index.html |
1833
378b566fd86b
Java EE version history
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1687
diff
changeset
|
312 |
Servlet 3.0 Specification |
1379 | 313 |
http://jcp.org/aboutJava/communityprocess/mrel/jsr154/index.html |
1833
378b566fd86b
Java EE version history
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1687
diff
changeset
|
314 |
Servlet 2.5 Specification |
1379 | 315 |
http://www.mularien.com/blog/2008/04/24/how-to-reference-and-use-jstl-in-your-web-application/ |
1833
378b566fd86b
Java EE version history
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1687
diff
changeset
|
316 |
How to Reference and Use JSTL in your Web Application |
1563
9b4441d30cac
Java interactive shell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1380
diff
changeset
|
317 |
|
9b4441d30cac
Java interactive shell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1380
diff
changeset
|
318 |
Java interactive shell. |
9b4441d30cac
Java interactive shell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1380
diff
changeset
|
319 |
======================= |
9b4441d30cac
Java interactive shell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1380
diff
changeset
|
320 |
|
9b4441d30cac
Java interactive shell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1380
diff
changeset
|
321 |
Just use Groovy. ``bsh`` is older alternative without code completion. |