Lines Matching refs:Java
8 @c circumlocutions like ``compiler for the Java language''.
10 @c the word ``Java'.
55 * Gcj: (gcj). Ahead-of-time compiler for the Java language
61 Generate header files from Java class files
63 Print information about Java source files
65 Print information about Java class files
66 * gij: (gcj)Invoking gij. GNU interpreter for Java bytecode
101 Java programming language. @command{gcj} can generate both @file{.class}
102 files and object files, and it can read both Java source code and
110 * Compatibility:: Compatibility between gcj and other tools for Java
114 * Invoking gij:: Interpreting Java bytecodes
132 @c man title gcj Ahead-of-time compiler for the Java language
179 Java source files.
181 Java bytecode files.
216 Java language, @command{gcj} has a notion of a @dfn{class path}. There are
295 The Java programming language uses Unicode throughout. In an effort to
361 @code{main}. Since Java does not have global functions, and a
362 collection of Java classes may have more than one class with a
468 @chapter Compatibility with the Java Platform
470 As we believe it is important that the Java platform not be fragmented,
471 @command{gcj} and @code{libgcj} try to conform to the relevant Java
489 and the new 1.4 @code{assert} keyword. It does not yet support the Java 2
497 @code{libgcj} and the Java 2 platform.
521 written in the Java programming language to native code. Most
526 @command{gcj} makes it easy and efficient to mix code written in Java and C++.
546 @c man title gcjh generate header files from Java class files
647 @c man title jv-scan print information about Java source file
651 The @code{jv-scan} program can be used to print information about a Java
710 @c man title jcf-dump print information about Java class files
765 @c man title gij GNU interpreter for Java bytecode
785 @code{gij} is a Java bytecode interpreter included with @code{libgcj}.
1029 which is is a convenient way to write Java native methods using C++.
1031 alternative to the standard JNI (Java Native Interface).
1036 * Primitive types:: Handling Java types in C++.
1037 * Interfaces:: How Java interfaces map to C++.
1038 * Objects and Classes:: C++ and Java classes.
1040 * Object allocation:: How to create Java objects in C++.
1041 * Arrays:: Dealing with Java arrays in C++.
1042 * Methods:: Java methods in C++.
1043 * Strings:: Information about Java Strings.
1046 * Synchronization:: Synchronizing between Java and C++.
1047 * Invocation:: Starting the Java runtime from C++.
1055 In terms of languages features, Java is mostly a subset
1056 of C++. Java has a few important extensions, plus a powerful standard
1058 Java is a hybrid object-oriented language, with a few native types,
1074 conventions). The key idea in CNI is that Java objects are C++
1075 objects, and all Java classes are C++ classes (but not the other way
1076 around). So the most important task in integrating Java and C++ is to
1080 a Java/CNI-aware C++ compiler, specifically a recent version of G++.)
1088 @noindent and then must include one header file for each Java class it uses, e.g.:
1099 CNI provides some functions and macros to make using Java objects and
1112 Whilst a Java class is just a C++ class that doesn't mean that you are
1113 freed from the shackles of Java, a @acronym{CNI} C++ class must adhere to the
1114 rules of the Java programming language.
1118 member variable of some non-Java datatype.
1124 The only global names in Java are class names, and packages. A
1129 A Java package is mapped to a C++ @dfn{namespace}. The Java class
1162 move from one package to another. The Java @code{package} declaration
1171 @noindent In Java:
1188 @noindent Java can also cause imports on demand, like this:
1208 Java provides 8 @dfn{primitives} types which represent integers, floats,
1212 so CNI provides a special C++ type for each primitive Java type:
1215 @item @strong{Java type} @tab @strong{C/C++ typename} @tab @strong{Description}
1227 When referring to a Java type You should always use these C++ typenames (e.g.: @code{jint})
1233 In Java each primitive type has an associated reference type,
1251 A Java class can @dfn{implement} zero or more
1287 All Java classes are derived from @code{java.lang.Object}. C++ does
1290 @code{java.lang.Object} Java class. All other Java classes are mapped
1309 to 32 bits. Note that the Java VM does extend 8-bit and 16-bit types
1313 class, you can access fields of Java classes in the @emph{natural}
1314 way. For example, given the following Java class:
1343 CNI does not strictly enforce the Java access
1344 specifiers, because Java permissions cannot be directly mapped
1345 into C++ permission. Private Java fields and methods are mapped
1354 Java requires that each class be automatically initialized at the time
1367 the Java system.
1372 both in Java code, and in C++ code. When G++ sees a @code{new} of a
1373 Java class, it will call a routine in @code{libgcj} to allocate the
1375 Note however that this does not happen for Java arrays; you must
1382 Java compiler adds code to the start of a static method to make sure
1390 field to be initialized. The Java compiler will generate code
1400 New Java objects are allocated using a
1408 C++ objects have to be explicitly deleted; in Java they are
1410 Using @acronym{CNI}, you can allocate a new Java object
1431 While in many ways Java is similar to C and C++, it is quite different
1433 arithmetic, which would be incompatible with Java's security
1434 requirements. Java arrays are true objects (array types inherit from
1438 Referencing a Java array in C++ code is done using the
1512 @noindent can be used to create an array of Java primitive boolean types.
1528 Java methods are mapped directly into C++ methods.
1532 @emph{corresponding} types as the Java methods,
1537 Both Java and C++ provide method overloading, where multiple
1541 in C++ than in Java, but given a set of overloaded methods
1550 The same mechanism is used to implement Java overloading.
1551 For C++/Java interoperability, it is important that both the Java
1556 Static Java methods are invoked in @acronym{CNI} using the standard
1590 Java does not allow a constructor to be a native method.
1597 Calling a Java instance method from a C++ @acronym{CNI} method is done
1601 // @r{First create the Java object.}
1609 @noindent Defining a Java native instance method is also done the natural way:
1624 In Java you can call a method using an interface reference. This is
1634 working with Java Java @code{String} objects.
1639 Returns a Java @code{String} object with characters from the C string
1644 Returns a Java @code{String} made up of @var{len} bytes from @var{bytes}.
1678 Because @acronym{CNI} is designed to represent Java classes and methods it
1681 One important restriction is that Java classes cannot have non-Java
1683 non-Java types as arguments or return non-Java types.
1691 char* variable; // @r{char* is not a valid Java type.}
1701 @} // @r{@code{uint} is not a valid Java type, neither is @code{char*}}
1763 While C++ and Java share a common exception handling framework,
1768 Still, things work fairly well. You can throw a Java exception from
1770 exception can be caught by Java code. Similarly, you can catch an
1771 exception thrown from Java using the C++ @code{catch}
1782 code that uses Java exceptions, and handle them appropriately.
1783 However, if C++ code only needs to execute destructors when Java
1790 extern void bar(); // @r{Is implemented in Java and may throw exceptions.}
1802 You can inform the compiler that Java exceptions are to be used in a
1812 Each Java object has an implicit monitor.
1813 The Java VM uses the instruction @code{monitorenter} to acquire
1821 The Java source language does not provide direct access to these primitives.
1840 So this Java code:
1858 Java also has methods with the @code{synchronized} attribute.
1875 CNI permits C++ applications to make calls into Java classes, in addition to
1876 allowing Java code to call into C++. Several functions, known as the
1880 Initializes the Java runtime. This function performs essential initialization
1883 a non-Java @code{main()} function, before any other Java or CNI calls are made.
1887 for the Java runtime. It may be @code{NULL}.
1896 Registers an existing thread with the Java runtime. This must be called once
1897 from each thread, before that thread makes any other Java or CNI calls. It
1903 The return value is the Java @code{Thread} object that represents the thread.
1910 Unregisters a thread from the Java runtime. This should be called by threads
1912 finished making calls to Java code. This ensures that any resources associated
1920 If an exception is thrown from Java code called using the invocation API, and
1924 block that catches all Java exceptions.
1929 example, the C++ application initializes the Java runtime and attaches
1931 access its @code{out} field, and a Java string is printed. Finally, the thread
1932 is detached from the runtime once it has finished making Java calls. Everything
1962 System::err->println(JvNewStringLatin1("Unhandled Java exception:"));
2012 libraries for the Java language.
2042 (Set to @samp{Java Virtual Machine Specification}).
2062 (Set to @samp{Java Platform API Specification}).
2165 @code{libgcj} is based on the GNU Classpath (Essential Libraries for Java) a
2167 and compilers for the Java language. The following properties are common to
2244 used The Java Language Specification (both first and second editions),
2245 the Java Class Libraries (volumes one and two), and the Java Virtual
2255 a free software Java class library test suite which is being written