public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gcj exception compiling
@ 2011-11-05 18:13 Kraus Philipp
  2011-11-06  1:28 ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 10+ messages in thread
From: Kraus Philipp @ 2011-11-05 18:13 UTC (permalink / raw)
  To: cygwin

Hello,

I try to build a Java class with the gcj under Cygwin. I get this error message:

Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.jdt.inter
nal.compiler.batch.GCCMain
   at gnu.java.lang.MainThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.b
atch.GCCMain not found in gnu.gcj.runtime.SystemClassLoader{urls=[], parent=gnu.
gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at gnu.java.lang.MainThread.run(Unknown Source)

The class does not have any main function. 
On the default gcj installation, it creates this error first:

/usr/lib/gcc/i686-pc-cygwin/4.5.3/ecj1.exe: error while loading shared libraries
: cyggcj-11.dll: cannot open shared object file: No such file or directory

So I install the gcj-11 library, the setup installs gcj-9 on default.

How can I create a working installation?

Thanks

Phil



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gcj exception compiling
  2011-11-05 18:13 gcj exception compiling Kraus Philipp
@ 2011-11-06  1:28 ` Yaakov (Cygwin/X)
  2011-11-06 20:16   ` Philipp Kraus
  2011-11-10  5:18   ` Dave Korn
  0 siblings, 2 replies; 10+ messages in thread
From: Yaakov (Cygwin/X) @ 2011-11-06  1:28 UTC (permalink / raw)
  To: cygwin

On Sat, 2011-11-05 at 19:13 +0100, Kraus Philipp wrote:
> Hello,
> 
> I try to build a Java class with the gcj under Cygwin. I get this error message:
> 
> Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.jdt.inter
> nal.compiler.batch.GCCMain
>    at gnu.java.lang.MainThread.run(Unknown Source)
> Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.b
> atch.GCCMain not found in gnu.gcj.runtime.SystemClassLoader{urls=[], parent=gnu.
> gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
>    at java.net.URLClassLoader.findClass(Unknown Source)
>    at java.lang.ClassLoader.loadClass(Unknown Source)
>    at java.lang.ClassLoader.loadClass(Unknown Source)
>    at gnu.java.lang.MainThread.run(Unknown Source)

You're missing the ECJ jar.  Either download
ftp://sourceware.org/pub/java/ecj-4.5.jar and install it
to /usr/share/java/ecj.jar or install java-ecj from Cygwin Ports.

> The class does not have any main function. 
> On the default gcj installation, it creates this error first:
> 
> /usr/lib/gcc/i686-pc-cygwin/4.5.3/ecj1.exe: error while loading shared libraries
> : cyggcj-11.dll: cannot open shared object file: No such file or directory
> 
> So I install the gcj-11 library, the setup installs gcj-9 on default.
> 
> How can I create a working installation?

Install libgcj11.

(P.S. Dave Korn: I took the liberty of fixing this on sourceware.)


Yaakov



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gcj exception compiling
  2011-11-06  1:28 ` Yaakov (Cygwin/X)
@ 2011-11-06 20:16   ` Philipp Kraus
  2011-11-07  2:05     ` Yaakov (Cygwin/X)
  2011-11-10  5:18   ` Dave Korn
  1 sibling, 1 reply; 10+ messages in thread
From: Philipp Kraus @ 2011-11-06 20:16 UTC (permalink / raw)
  To: cygwin

On 2011-11-06 02:28:12 +0100, Yaakov (Cygwin/X) said:

> On Sat, 2011-11-05 at 19:13 +0100, Kraus Philipp wrote:
>> Hello,
>> 
>> I try to build a Java class with the gcj under Cygwin. I get this error 
>> message:
>> 
>> Exception in thread "main" java.lang.NoClassDefFoundError: 
>> org.eclipse.jdt.inter
>> nal.compiler.batch.GCCMain
>> at gnu.java.lang.MainThread.run(Unknown Source)
>> Caused by: java.lang.ClassNotFoundException: 
>> org.eclipse.jdt.internal.compiler.b
>> atch.GCCMain not found in gnu.gcj.runtime.SystemClassLoader{urls=[], 
>> parent=gnu.
>> gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
>> at java.net.URLClassLoader.findClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at gnu.java.lang.MainThread.run(Unknown Source)
> 
> You're missing the ECJ jar.  Either download
> ftp://sourceware.org/pub/java/ecj-4.5.jar and install it
> to /usr/share/java/ecj.jar or install java-ecj from Cygwin Ports.

Thanks, but under /usr/sbin/ should be a script like download_ecj.sh
for downloading and installing, but in my Cygwin version the script
does not exists

> 
>> The class does not have any main function.
>> On the default gcj installation, it creates this error first:
>> 
>> /usr/lib/gcc/i686-pc-cygwin/4.5.3/ecj1.exe: error while loading shared 
>> libraries
>> : cyggcj-11.dll: cannot open shared object file: No such file or directory
>> 
>> So I install the gcj-11 library, the setup installs gcj-9 on default.
>> 
>> How can I create a working installation?
> 
> Install libgcj11.
> 
> (P.S. Dave Korn: I took the liberty of fixing this on sourceware.)

If I try to compile a java code with "gcj mysource.java" I get the error:

/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../libcygwin.a(libcmain.o):(.text+0xa9): 

 undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status

How can I solve the linker problem? (I have installed the newest 
version of Cygwin)

Thanks
Phil



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gcj exception compiling
  2011-11-06 20:16   ` Philipp Kraus
@ 2011-11-07  2:05     ` Yaakov (Cygwin/X)
  2011-11-07  6:36       ` Philipp Kraus
  0 siblings, 1 reply; 10+ messages in thread
From: Yaakov (Cygwin/X) @ 2011-11-07  2:05 UTC (permalink / raw)
  To: cygwin

On Sun, 2011-11-06 at 21:16 +0100, Philipp Kraus wrote:
> If I try to compile a java code with "gcj mysource.java" I get the error:
> 
> /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../libcygwin.a(libcmain.o):(.text+0xa9): 
> 
>  undefined reference to `_WinMain@16'
> collect2: ld returned 1 exit status

http://gcc.gnu.org/java/faq.html#4_1


Yaakov



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gcj exception compiling
  2011-11-07  2:05     ` Yaakov (Cygwin/X)
@ 2011-11-07  6:36       ` Philipp Kraus
  2011-11-07 14:12         ` Jon Clugston
  0 siblings, 1 reply; 10+ messages in thread
From: Philipp Kraus @ 2011-11-07  6:36 UTC (permalink / raw)
  To: cygwin

On 2011-11-07 03:05:48 +0100, Yaakov (Cygwin/X) said:

> On Sun, 2011-11-06 at 21:16 +0100, Philipp Kraus wrote:
>> If I try to compile a java code with "gcj mysource.java" I get the error:
>> 
>> /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../libcygwin.a(libcmain.o):(.text+0xa9): 
>> 
>> 
>> undefined reference to `_WinMain@16'
>> collect2: ld returned 1 exit status
> 
> http://gcc.gnu.org/java/faq.html#4_1


In a posting earlier I have written, that the class does not have any 
main method, so the
information to setup the --main flag does not help. In my project there 
are only
abstract classes, interface classes and classes without main methods, 
so I would like
to compile the sources to *.class files

Phil



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gcj exception compiling
  2011-11-07  6:36       ` Philipp Kraus
@ 2011-11-07 14:12         ` Jon Clugston
  0 siblings, 0 replies; 10+ messages in thread
From: Jon Clugston @ 2011-11-07 14:12 UTC (permalink / raw)
  To: cygwin

>
> In a posting earlier I have written, that the class does not have any main
> method, so the
> information to setup the --main flag does not help. In my project there are
> only
> abstract classes, interface classes and classes without main methods, so I
> would like
> to compile the sources to *.class files
>
> Phil
>
>

RTFM.
http://linux.die.net/man/1/gcj

Pass the "-C" flag to the compiler to tell it to generate .class files
instead of an executable.

Jon

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gcj exception compiling
  2011-11-06  1:28 ` Yaakov (Cygwin/X)
  2011-11-06 20:16   ` Philipp Kraus
@ 2011-11-10  5:18   ` Dave Korn
  2011-11-10  5:29     ` Dave Korn
  1 sibling, 1 reply; 10+ messages in thread
From: Dave Korn @ 2011-11-10  5:18 UTC (permalink / raw)
  To: cygwin

On 06/11/2011 01:28, Yaakov (Cygwin/X) wrote:

> Install libgcj11.
> 
> (P.S. Dave Korn: I took the liberty of fixing this on sourceware.)

  Thanks Yaakov.

  (That's now three things to remember for next build: remove ecj dependency,
change libgcj9 -> 11, add missing libmpfr4.  I need a notebook....)

    cheers,
      DaveK


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gcj exception compiling
  2011-11-10  5:18   ` Dave Korn
@ 2011-11-10  5:29     ` Dave Korn
  2011-11-10  5:53       ` Yaakov (Cygwin/X)
  2011-11-10  6:07       ` Christopher Faylor
  0 siblings, 2 replies; 10+ messages in thread
From: Dave Korn @ 2011-11-10  5:29 UTC (permalink / raw)
  To: cygwin

On 10/11/2011 05:17, Dave Korn wrote:
> On 06/11/2011 01:28, Yaakov (Cygwin/X) wrote:
> 
>> Install libgcj11.
>>
>> (P.S. Dave Korn: I took the liberty of fixing this on sourceware.)
> 
>   Thanks Yaakov.
> 
>   (That's now three things to remember for next build: remove ecj dependency,
> change libgcj9 -> 11, add missing libmpfr4.  I need a notebook....)

  *Four* things to remember for next build: remove ecj dependency, change
libgcj9 -> 11, add missing libmpfr4, and restore the missing download_ecj.sh
script.  I wasn't expecting some kind of a Spanish Inquisition ......

    cheers,
      DaveK


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gcj exception compiling
  2011-11-10  5:29     ` Dave Korn
@ 2011-11-10  5:53       ` Yaakov (Cygwin/X)
  2011-11-10  6:07       ` Christopher Faylor
  1 sibling, 0 replies; 10+ messages in thread
From: Yaakov (Cygwin/X) @ 2011-11-10  5:53 UTC (permalink / raw)
  To: cygwin

On Thu, 2011-11-10 at 05:29 +0000, Dave Korn wrote:
>   *Four* things to remember for next build: remove ecj dependency, change
> libgcj9 -> 11, add missing libmpfr4, and restore the missing download_ecj.sh
> script.  I wasn't expecting some kind of a Spanish Inquisition ......

I keep all the build files for a package in a persistent,
version-controlled directory (one dir per source package) so that
whenever I come to change or update a package, the files are all ready
to go.  Fixes like these could be made now to your local copy so that
you don't forget when you next update the package.

As for ecj, I'm afraid that was my fault; I have a package in Ports as
part of the Java stack, so my gcc4-java worked OOTB.


Yaakov



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gcj exception compiling
  2011-11-10  5:29     ` Dave Korn
  2011-11-10  5:53       ` Yaakov (Cygwin/X)
@ 2011-11-10  6:07       ` Christopher Faylor
  1 sibling, 0 replies; 10+ messages in thread
From: Christopher Faylor @ 2011-11-10  6:07 UTC (permalink / raw)
  To: cygwin

On Thu, Nov 10, 2011 at 05:29:14AM +0000, Dave Korn wrote:
>On 10/11/2011 05:17, Dave Korn wrote:
>> On 06/11/2011 01:28, Yaakov (Cygwin/X) wrote:
>> 
>>> Install libgcj11.
>>>
>>> (P.S. Dave Korn: I took the liberty of fixing this on sourceware.)
>> 
>>   Thanks Yaakov.
>> 
>>   (That's now three things to remember for next build: remove ecj dependency,
>> change libgcj9 -> 11, add missing libmpfr4.  I need a notebook....)
>
>  *Four* things to remember for next build: remove ecj dependency, change
>libgcj9 -> 11, add missing libmpfr4, and restore the missing download_ecj.sh
>script.  I wasn't expecting some kind of a Spanish Inquisition ......

That's understandable.  Nobody really does.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2011-11-10  6:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-05 18:13 gcj exception compiling Kraus Philipp
2011-11-06  1:28 ` Yaakov (Cygwin/X)
2011-11-06 20:16   ` Philipp Kraus
2011-11-07  2:05     ` Yaakov (Cygwin/X)
2011-11-07  6:36       ` Philipp Kraus
2011-11-07 14:12         ` Jon Clugston
2011-11-10  5:18   ` Dave Korn
2011-11-10  5:29     ` Dave Korn
2011-11-10  5:53       ` Yaakov (Cygwin/X)
2011-11-10  6:07       ` Christopher Faylor

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