From: mohan NMH <mohan.nmh2@gmail.com>
To: java@gcc.gnu.org
Subject: Fwd: gcj can not import packages
Date: Wed, 09 Nov 2016 11:29:00 -0000 [thread overview]
Message-ID: <CANV4Oqhm440dav4AONgwW87VJ3+0c0S7KjdvnjwW+7V_VP2WJg@mail.gmail.com> (raw)
In-Reply-To: <CANV4OqjehvrZUaMGbwn0Gu3KsesTy7aWVhY9cPETpnqwf_Zo0A@mail.gmail.com>
Can someone help me to understand why gcj can not import packages
while javac can? Any CLASSPATH setting required?
[user5@FOO-51 tmp]$ gcj -v
Using built-in specs.
Reading specs from
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../libgcj.spec
rename spec startfile to startfileorig
rename spec lib to liborig
COLLECT_GCC=gcj
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --with-java-home=/usr/jdk1.8.0_111/jre/
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar
Thread model: posix
gcc version 4.9.0 (GCC)
[user5@FOO-51 tmp]$
[user5@FOO-51 tmp]$
[user5@FOO-51 tmp]$
[user5@FOO-51 tmp]$ cat HelloWorld.java
import java.util.Objects;
import java.nio.file.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
public class HelloWorld {
public static void main (String[] args) {
System.out.println ("Hello World!");
}
}
[user5@FOO-51 tmp]$
[user5@FOO-51 tmp]$ echo $CLASSPATH
[user5@FOO-51 tmp]$
[user5@FOO-51 tmp]$
[user5@FOO-51 tmp]$ javac -version
javac 1.8.0_111
[user5@FOO-51 tmp]$ javac HelloWorld.java
[user5@FOO-51 tmp]$ java HelloWorld
Hello World!
[user5@FOO-51 tmp]$
[user5@FOO-51 tmp]$ gcj --main=HelloWorld HelloWorld.class
[user5@FOO-51 tmp]$ ./a.out
Hello World!
[user5@FOO-51 tmp]$
[user5@FOO-51 tmp]$ gcj --main=HelloWorld HelloWorld.java
HelloWorld.java:1: error: The import java.util.Objects cannot be resolved
import java.util.Objects;
^^^^^^^^^^^^^^^^^
HelloWorld.java:2: error: The import java.nio.file cannot be resolved
import java.nio.file.*;
^^^^^^^^^^^^^
HelloWorld.java:3: error: The import
java.util.concurrent.CompletableFuture cannot be resolved
import java.util.concurrent.CompletableFuture;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
HelloWorld.java:4: error: The import
java.util.concurrent.CompletionStage cannot be resolved
import java.util.concurrent.CompletionStage;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 problems (4 errors)
[user5@FOO-51 tmp]$
next parent reply other threads:[~2016-11-09 11:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CANV4OqjehvrZUaMGbwn0Gu3KsesTy7aWVhY9cPETpnqwf_Zo0A@mail.gmail.com>
2016-11-09 11:29 ` mohan NMH [this message]
2016-11-09 12:26 ` Andrew Haley
2016-11-09 12:49 ` mohan NMH
2016-11-09 13:29 ` Andrew Haley
2017-01-16 17:41 ` Bill Chatfield via java
2017-01-16 20:10 ` Ricardo Wurmus
2017-01-16 22:58 ` Bill Chatfield via java
2017-01-16 23:24 ` Anthony Green
2017-01-17 9:56 ` Andrew Haley
2017-01-18 20:29 ` Ricardo Wurmus
2017-01-18 20:40 ` Matthias Klose
2017-01-18 20:59 ` Ricardo Wurmus
2017-01-19 9:59 ` Andrew Haley
[not found] ` <CAFXTvn525N1D_EOuCAWXSJugCpZCZCkc5GfuhNJ1nPoDK0DAoQ@mail.gmail.com>
2017-05-17 20:26 ` Ricardo Wurmus
2017-01-17 9:58 ` Andrew Haley
2017-01-17 15:21 ` Bill Chatfield via java
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CANV4Oqhm440dav4AONgwW87VJ3+0c0S7KjdvnjwW+7V_VP2WJg@mail.gmail.com \
--to=mohan.nmh2@gmail.com \
--cc=java@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).