public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: MessageBundle ???
@ 2011-04-04 13:04 dj_def
  2011-04-04 13:09 ` Andrew Haley
  0 siblings, 1 reply; 12+ messages in thread
From: dj_def @ 2011-04-04 13:04 UTC (permalink / raw)
  To: java

> It should just detect /usr/bin/gcj .  What is i686-pc-linux-gnu-gcj doing 
> is
> /usr/bin anyway?

Yes, in ubuntu /usr/bin/i686-linux-gnu-gcj points to /usr/bin/gcj-x.x where 
x-x is the version. Even /usr/bin/gcj points to /usr/bin/gcj-x.x (so the 
debian update-alternatives script can make you choose among versions simply 
modifying the /usr/bin/gcj link).
The link I made (i686-pc-linux-gnu-gcj) points to 
/usr/bin/i686-linux-gnu-gcj that points to /usr/bin/gcj-x.x .

A question: especially for prerequisites and dependancies, are there 
specific instructions when cross-compiling for windows? Should I consider 
http://kegel.com/crosstool/ as the main reference?
Thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread
* MessageBundle ???
@ 2011-04-04 12:00 dj_def
  2011-04-04 12:13 ` Andrew Haley
  0 siblings, 1 reply; 12+ messages in thread
From: dj_def @ 2011-04-04 12:00 UTC (permalink / raw)
  To: java

I did other tests: I compiled gcc-4.3.0 (with 4.6 and 4.7 I was unable to 
compile because of libltdl errors and missing jvm.exe) correcting 
Formatter.java and with --enable-maintainer-mode.
To make it succesfully I had to

1) sudo ln -sf /usr/bin/i686-linux-gnu-gcj /usr/bin/i686-pc-linux-gnu-gcj
(I did this because during some gcc configuration process, it detects 
/usr/bin/i686-pc-linux-gnu-gcj instead of /usr/bin/i686-linux-gnu-gcj...
it could be some ubuntu packaging issue as before compiling I installed the 
whole gcc ubuntu package...)


2) gcj 
/pathToSrcDir/gcc-4.3.0/ecj.jar -findirect-dispatch --main=org.eclipse.jdt.internal.compiler.batch.GCCMain 
 -o ~/moveinecj1
   sudo mv ~/moveinecj1 /usr/bin/ecj1
   sudo chmod +x /usr/bin/ecj1
(this should be a known issue when cross-compiling)

Well... with this version there is not any "MessagesBundle.properties 
missing resource problem" but the previous problem is not completely solved:

class Test {
  public static void main(String argv[]) {
    System.out.printf("%09.3f%n",3.1415926535);
  }
}

this time the program does not crash but also does not print anything (it 
could be normal as now it uses parseInt).

The other test with the openConnection() function now succeeds :)
I did as you told me:
gcj --resource java/util/iso4217.properties -c 
pathTo\libjava\classpath\resource\java\util\iso4217.properties -o 
iso4217.properties.o

Thank you for all! 

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: MessageBundle ???
@ 2011-04-01 14:22 dj_def
  2011-04-01 14:57 ` Andrew Haley
  0 siblings, 1 reply; 12+ messages in thread
From: dj_def @ 2011-04-01 14:22 UTC (permalink / raw)
  To: java

1)
There is this test that is working under gcc 4.3.0 compiled by me with
ecj1.exe created under ubuntu linux 11.04 (with i686-pc-mingw32-gcj
cross compiler).
This same test is not working with thisiscool gcc 4.3.0 (eclipse):
import java.util.*;
import java.util.regex.*;
public class Test {
  static public void  main (String[] argv) {
    String s = new String("hom hom");
    String t = new String("om");
    String u = s.replaceAll(t, "i Jack!");
    System.out.println(u);
  }
}------------->gives: java.lang.NumberFormatException: invalid character
at position 1 g$ò< ...


2)
This other test is not working with both the versions.

class Test {

   public static void main(String argv[]) {

       System.out.printf("%09.3f%n",3.1415926535);
   }
}

-------------> gives a: Exception in thread "main"
java.lang.NumberFormatException: invalid character at position 2 in 09


3)
This last test works with thisiscool gcc and not with the gcc I
compiled:

import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class LastTest {
  public static void main(String args[]) {
    try {
      URL url = new URL("http://www.google.it");
      url.openConnection();
    }
    catch(Exception e) {
      System.out.println("exception");
    }
  }
}------------->the execution gives:
Exception in thread "main" java.lang.ExceptionInInitializerError
   at
java.lang.Class.initializeClass(/extra/src/gcc-4.3.0/libjava/java/lang/nat
Class.cc:792)
   at
java.util.Currency.getInstance(/extra/wgcc/sys-root/i686-pc-mingw32/libjav
a/java/util/Currency.java:290)
   at
java.text.DecimalFormatSymbols.<init>(/extra/wgcc/sys-root/i686-pc-mingw32
/libjava/java/text/DecimalFormatSymbols.java:161)
   at
java.text.DecimalFormat.<clinit>(/extra/wgcc/sys-root/i686-pc-mingw32/libj
ava/java/text/DecimalFormat.java:96)
   at
java.lang.Class.initializeClass(/extra/src/gcc-4.3.0/libjava/gcj/cni.h:99)

   at
gnu.java.net.protocol.http.HTTPDateFormat.<init>(/extra/wgcc/sys-root/i686
-pc-mingw32/libjava/gnu/java/net/protocol/http/HTTPDateFormat.java:75)
   at
gnu.java.net.protocol.http.Headers.<clinit>(/extra/wgcc/sys-root/i686-pc-m
ingw32/libjava/gnu/java/net/protocol/http/Headers.java:76)
   at
java.lang.Class.initializeClass(/extra/src/gcc-4.3.0/libjava/gcj/cni.h:99)

   at
gnu.java.net.protocol.http.HTTPURLConnection.<init>(/extra/wgcc/sys-root/i
686-pc-mingw32/libjava/gnu/java/net/protocol/http/HTTPURLConnection.java:101)
   at
gnu.java.net.protocol.http.Handler.openConnection(/extra/wgcc/sys-root/i68
6-pc-mingw32/libjava/gnu/java/net/protocol/http/Handler.java:69)
   at
java.net.URL.openConnection(/extra/wgcc/sys-root/i686-pc-mingw32/libjava/j
ava/net/URL.java:724)
   at Test.<init>(ccSsHWJM.jar:0)
Caused by: java.lang.NullPointerException
   at
java.io.InputStreamReader.read(/extra/wgcc/sys-root/i686-pc-mingw32/libjav
a/java/io/InputStreamReader.java:246)
   at
java.io.BufferedReader.fill(/extra/wgcc/sys-root/i686-pc-mingw32/libjava/j
ava/io/BufferedReader.java:374)
   at
java.io.BufferedReader.readLine(/extra/wgcc/sys-root/i686-pc-mingw32/libja
va/java/io/BufferedReader.java:476)
   at
java.util.Properties.load(/extra/wgcc/sys-root/i686-pc-mingw32/libjava/jav
a/util/Properties.java:201)
   at
java.util.Currency.<clinit>(/extra/wgcc/sys-root/i686-pc-mingw32/libjava/j
ava/util/Currency.java:136)
   at
java.lang.Class.initializeClass(/extra/src/gcc-4.3.0/libjava/gcj/cni.h:99)

   ...11 more


WTH!!! Is this an April's fish? :D
I would like to have working connections and working replaceAll at the
same time... is it possible? :)
Are we facing the same problem of previous mail or this is another
problem?
How could this be solved? Please save me! 


ps. I could get rid of the MessageBundle problem linking everytime a
libgcj.o created with gcj --resource
gnu/java/util/regex/MessagesBundle.properties C:\wgcc\share\java
\libgcj-4.3.0.jar and then compiling the application with: gcj
--main=MainName MainName.java libgcj.o -o Output.exe

^ permalink raw reply	[flat|nested] 12+ messages in thread
* MessageBundle ???
@ 2011-04-01  8:51 dj_def
  2011-04-01  9:57 ` Andrew Haley
  0 siblings, 1 reply; 12+ messages in thread
From: dj_def @ 2011-04-01  8:51 UTC (permalink / raw)
  To: java

I have problems with all java programs containing regex and string
functions like split() or replace()/replaceAll().
This programs will compile and run correctly on linux but will compile
and crash on windows; the output says something about a missing resource
(MessageBundle). I tried many things to get around of this but I did not
find any solution.
I would like to better understand why this happens but the most
important thing would be to find a solution.
I use this class as an example:

import java.util.regex.Pattern;
class FFooClass {
  public static void main(String args[]) {
    Pattern p = Pattern.compile("bye");
    System.out.println("bye");
  }
}

I do:
gcj --main FFoo.java -o FFoo
on linux and it works!
I do:
gcj --main FFoo.java -o FFoo.exe
on windows (or even with a cross compiler for linux) and the app
FFoo.exe doesn't work!
Starting from this class, what are the steps to get a working exe?

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-04-04 13:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-04 13:04 MessageBundle ??? dj_def
2011-04-04 13:09 ` Andrew Haley
  -- strict thread matches above, loose matches on Subject: below --
2011-04-04 12:00 dj_def
2011-04-04 12:13 ` Andrew Haley
2011-04-01 14:22 dj_def
2011-04-01 14:57 ` Andrew Haley
2011-04-01 17:43   ` Andrew Haley
2011-04-01 19:32     ` Mark Wielaard
2011-04-04  9:38       ` Andrew Haley
2011-04-01  8:51 dj_def
2011-04-01  9:57 ` Andrew Haley
2011-04-01 10:09   ` Andrew Haley

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).