Use Java_Wrapper (https://ja.osdn.net/projects/javaoncygwin/) to prepare an environment to use Java with MSYS2 and Cygwin.
The installation destination is as follows.
/usr/local/bin
Download Java_Wrapper from Official Site to the installation folder.
Put the path in the environment variable as follows.
--Java_HOME = Folder where the JDK is installed
The downloaded java_wrapper is a shell script. Since the character code of Java in Windows is encoded in cp932 (Shift-JIS), if it is executed through the path, it will naturally be garbled on MSYS and Cygwin.
So I'll fix it as follows.
-exec "$PROGRAM" $ARGS
+exec "$PROGRAM" $ARGS 2>&1 | iconv -f cp932 -t utf-8
After moving to the installation folder, type the following command.
$ java_wrapper createsymlinks
All executables in *% JAVA_HOME% \ bin * are now executed through java_wrapper.
I will actually run it.
$ java
how to use: java [-options] class [args...]
(When executing a class)
Or java[-options] -jar jarfile [args...]
(When executing a jar file)
The options include:
-d32 Use 32-bit data model if available
-d64 Use 64-bit data model if available
-server "server"When selecting a VM
The default VM is server.
-cp <Directory and zip/Class search path for jar files>
-classpath <Directory and zip/Class search path for jar files>
Directory to search for class files,
JAR archive and ZIP archive;The list is separated by.
-D<name>=<value>
Set system properties
-verbose:[class|gc|jni]
Perform detailed output
-version Output the product version and exit
-version:<value>
warning:This feature is deprecated and will be released in detail
It will be abolished.
Make the specified version mandatory for execution
-showversion Output product version and continue
-jre-restrict-search | -no-jre-restrict-search
warning:This feature is deprecated and will be released in detail
It will be abolished.
Include user's private JRE in version search/exclude
-? -help Print this help message
-Print help on X non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
Enable assertions at the specified particle size
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
Disable assertions at the specified particle size
-esa | -enablesystemassertions
Enable system assertions
-dsa | -disablesystemassertions
Disable system assertions
-agentlib:<libname>[=<options>]
Native agent library<libname>To load. Example: -agentlib:hprof
-agentlib:jdwp=with help-agentlib:hprof=See also help
-agentpath:<pathname>[=<options>]
Load the native agent library with the full pathname
-javaagent:<jarpath>[=<options>]
Load the Java programming language agent. java.lang.See instrument
-splash:<imagepath>
Display the splash screen with the specified image
For more information http://www.oracle.com/technetwork/java/javase/documentation/index.See html.
I was able to call Java without garbled characters.
$ javac
how to use: javac <options> <source files>
The available options are:
-g Generate all debug information
-g:none Do not generate debug information
-g:{lines,vars,source}Generate only some debug information
-nowarn do not raise a warning
-Print a message about the behavior of the verbose compiler
-deprecation Prints the location of sources where deprecated APIs are used
-classpath <path>Specifies where to search user class files and annotation processors
-cp <path>Specifies where to search user class files and annotation processors
-sourcepath <path>Specifies where to search the input source file
-bootclasspath <path>Override bootstrap classpath location
-extdirs <dirs>Override the location of installed extensions
-endorseddirs <dirs>Override recommended standard path location
-proc:{none,only}Controls whether annotation processing or compilation is performed.
-processor <class1>[,<class2>,<class3>...]The name of the annotation processor to run. Bypass the default detection process
-processorpath <path>Specifies where to search the annotation processor
-Generates metadata for reflection in the parameters method parameter
-d <directory>Specifies where to store the generated class files
-s <directory>Specifies where to store the generated source files
-h <directory>Specifies where to store the generated native header files
-implicit:{none,class}Specifies whether to generate class files for implicitly referenced files
-encoding <encoding>Specifies the character encoding used by the source file
-source <release>Maintain source compatibility with the specified release
-target <release>Generate class files for a particular VM version
-profile <profile>Check if the API used is available in the specified profile
-version Version information
-help Print a summary of standard options
-Akey[=value]Options passed to the annotation processor
-X Print a summary of non-standard options
-J<flag> <flag>Pass directly to the execution system
-Quit compilation if Werror warning occurs
@<filename>Read from file options and filename
I was able to call javac without garbled characters.
Recommended Posts