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