A programming language announced by Sun Microsystem in 1995.
JRE(Java Runtime Environment) --Java application execution environment. --Can execute jar files and class files.
JDK(Java Development Kit) --Java application development environment. --Includes tools such as compiler and debugger.
Refer to "Introduction to Java" P16-17
Understand what the IDE is doing --Know what you can and cannot do with the IDE --Appropriate settings can be made in the IDE
You will be able to resolve errors that occur in the IDE
Personal opinion
sample \ Hello.class
.javac sample\Hello.java
sample/Hello.java
package sample;
/** Print Hello World */
public class Hello {
public static void main(String[] args) {
System.out.println("Hello");
}
}
java sample.Hello
REM ⇒ "Hello"
A Java class file is a file (with a .class extension) that contains Java bytecode that can be executed on the Java Virtual Machine (JVM).
javap -verbose sample\Hello
It needs to be set to refer to an external library (jar file, etc.).
The classpath is the path that the Java Runtime Environment (JRE) searches for classes and other resource files.
The class search path (class path) can be set with the -classpath option (the recommended method) when calling the JDK tools, or by setting the CLASSPATH environment variable. The -classpath option is recommended because it can be set individually for each application so that it does not affect other applications or change this value.
Abbreviation for ** J ** ava ** AR ** chive.
The> jar command is a general purpose archiving and compression tool based on the ZIP and ZLIB compression formats. However, the main purpose of the jar command is to package several Java applets and applications into a single archive.
[Try] Change the extension of the jar file to "zip" and confirm that it can be unzipped. [Try] Extract the jar file with the jar command.
REM -x:Deployment, -v:Detailed information output, -f:File name specification
jar -xvf sample.jar
In the jar file, there is a manifest file called META-INF / MANIFEST.MF
.
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: 1.5.0_22 (Sun Microsystems Inc.)
Built-By: hen
Build-Jdk: 1.5.0_22
Implementation-Title: Commons Lang
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Implementation-Version: 3.0
~ Omitted below ~
The manifest file describes the version and the tools used to create the jar file.
Part of the Java Options category.
Standard option --Supported by all Java Virtual Machine (JVM) implementations
Non-standard option
--A generic option specific to Java HotSpot virtual machines. Not guaranteed to be supported by all JVM implementations
--Starts with -X
Extended runtime options
--Developer options for use in tuning specific areas of Java HotSpot virtual machine operations
--Starts with -XX
--The Boolean -XX option is valid with a plus sign and invalid with a minus sign. (-XX: + OptionName
, -XX: -OptionName
)
Refer to Oracle Reference java
-Dproperty = value
: Set the value of the system property
---Duser.language = ja
, -Duser.country = JP
, etc.
--In Java source, you can get the value with System.getProperty ("user.language ");
--Specified by JVM argument in Tomcat Configure Manager
-Xmxsize
: Specifies the maximum size (in bytes) of the memory allocation pool
---Xmx1024m
: Specify 1024MB
-XX: + UseGCLogFileRotation
: Enable GC log rotation
Reference site Java HotSpot VM Options
Java EE
javax. *
Package (some Java SE classes start with javax)How to check the Java command version.
java -version
⇒ java version "1.8.0_131"
Updates will be available on a regular basis at Oracle. When an update occurs, the version string will also include the updated version number. In other words, in JDK 8 update 5 (JDK 8u5), the version string will be "1.8.0_5".
Applications that use Java (such as Tomcat) may set environment variables such as JAVA_HOME
and JAVA_OPTS
.
Recommended Posts