This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: jc1 out of memory error gcc 4.2.2 Linux 64-bit OS


>  > I am trying to compile a java app. I don't have the script in front of
>  > me that i am using because I am at a client's office right now. The
>  > jist of
>  > the command line is as follows:
>  >
>  > gcj -O -fjni -s -main=main.App --classpath=x1.jar x2.jar x3.jar x4.jar
>  > x5.jar x6.jar x7.jar x8.jar -o scln.exe class1.java class2.java
>  > class3.java ... class125.java -ly -ldz
>
> This is very likely to cause out of memory errors.  This will probably
> work better:
>
> gcj -c -O -fjni --classpath=x1.jar x2.jar
> gcj -c -O -fjni --classpath=x1.jar x3.jar
> gcj -c -O -fjni --classpath=x1.jar x4.jar
>
> And link them all together at the end.


Thanks to everyone for their kind help and advice. I tried Andrew's
advice out as noted above, and it worked! I was finally able to
generate a windows executable on 64 bit processors . On another note,
I had to process all my classes as class files and not as java files
for this to work. There is one last issue, of which I have a feeling
may not be a big issue. When I double click on my executable, I get
the following stacktrace printed out to a command prompt window:

Exception in thread "main" java.lang.NoClassDefFoundError: main.App
 at java.lang.Class.initializeClass(/datal/gcc/gcc/gcc/libgcc2.c:0)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Listener no
t found in gnu.gcj.runtime.SystemClassLoader{urls=[file:.\], parent=gnu.gcj.runt
ime.ExtensionClassLoader{urls=[], parent=null}}
 at java.net.URLClassLoader.findClass(/datal/gcc/gcc/libjava/java/net/URLClass
Loader.java:1080)
 at java.lang.ClassLoader.loadClass(/datal/gcc/gcc/libjava/java/lang/ClassLoad
er.java:351)
 at java.lang.ClassLoader.loadClass(/datal/gcc/gcc/libjava/java/lang/ClassLoad
er.java:295)
 at java.lang.VMClassLoader.defineClass(/datal/gcc/gcc/libjava/classpath/java/
io/Writer.java:187)
 at java.lang.ClassLoader.defineClass(/datal/gcc/gcc/libjava/java/lang/ClassLo
ader.java:483)
 at java.security.SecureClassLoader.defineClass(/datal/gcc/gcc/libjava/classpa
th/java/security/SecureClassLoader.java:108)
 at java.net.URLClassLoader.findClass(/datal/gcc/gcc/libjava/java/net/URLClass
Loader.java:1171)
 at java.lang.ClassLoader.loadClass(/datal/gcc/gcc/libjava/java/lang/ClassLoad
er.java:351)
 at java.lang.ClassLoader.loadClass(/datal/gcc/gcc/libjava/java/lang/ClassLoad
er.java:295)
 at java.lang.Class.initializeClass(/datal/gcc/gcc/gcc/libgcc2.c:0)

It looks like it is not able to find or load the swt library i use for
my app. I have compiled, and linked the swt jar to the executable, and
the corresponding swt dll is in the same directory where my executable
is located. The following line below is used to generate my
executable:

gcj -O -fjni -findirect-dispatch "--classpath=
C:/lib/x1.jar;C:/lib/x2.jar" --main=main.App -o scnlm.exe y1.class
y2.class -LC:/projects/java/TSCN/Desktop/3232 -lswt -lswt-win32-3232

Note all of the jars have been compiled into libswt, including swt.jar

--
Harpal Grover
President
Harpal Grover Consulting Inc


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]