OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libjava/] [classpath/] [doc/] [www.gnu.org/] [faq/] [faq.wml] - Blame information for rev 14

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 14 jlechner
#!wml --include=..
2
 
3
#include "include/layout.wml"
4
 
5
##
6
#
7
# Special Tags
8
#
9
 
10
 
11
 
12
#
13
# 
         
14
#       answer
15
#       answer
16
# 
17
#
18
 
19
# the section counter
20
#
21
22
 
23
24
        
25
        
26
{#FAQINDEX#:
27
                . 
28
                
29
:#FAQINDEX#}
30
        . 
31
        
32
        %body
33
{#FAQINDEX#:
34
                
35
                
36
:#FAQINDEX#}
37
        
38
        
39
40
 
41
42
43
44
{#FAQINDEX#:
45
        . 
46
:#FAQINDEX#}
47
        

.

48
        %body
49
        
50
51
52
53
 
54
 
55
56
 
57
58
 
59
60
{#FAQINDEX#}
61
 
62
63
64

GNU Classpath is a set of essential libraries for supporting

65
the Java programming language.

66
 
67

Classpath serves the same role that

68
href="http://www.gnu.org/software/libc/libc.html">libc has for C,
69
but is much richer in functionality. The broadness of the standard
70
library is an important reason why Java has been so successful. For
71
example, the library includes frameworks to convert between character
72
encodings, for accessing relational databases, for building Graphical
73
User Interfaces, for encryption, for logging, and for numerous other
74
tasks that are needed to build complex applications.

75
 
76
77
 
78
79

On the GNU operating system, we want to run software independent of

80
the programming language in which it was written. Because Java is
81
widespread, and because Java has some nice features, we want to
82
support Java as well.

83
 
84
85
 
86
87

Sun Microsystems, the company who has created Java, currently

88
distributes the “Java Development Kit” and “Java
89
Runtime Environment” at no cost. The former even comes with the
90
source code of the standard class library. However, the “Sun
91
Community Source License” 
92
href="http://www.gnu.org/licenses/license-list.html#SunCommunitySourceLicense">does
93
not grant essential freedoms, for example the right to distribute
94
a modified version of the code.

95
 
96

Therefore, Sun’s implementation does not qualify as Free

97
Software.

98
 
99
100
 
101
102
 
103

Though it would be helpful if Sun would open their sources, this is not the

104
most important step toward a free Java. Even more important for a free Java are:
105
106
  • Access to the TCK (Technology Compatibility Kits) on acceptable terms
  • 107
  • Involvement in the JCP without contamination or other unacceptable
  • 108
       constraints
    109
  • Easing of the requirements on subsetting. The free software
  • 110
       community doesn't work well with the "one big perfect release"
    111
       model that Sun seems to want.
    112
    113
     
    114

    There was already a lot of discussions around this topic on other sites:

    115
    116
  • 117
  • 118
  • 119
    120
     
    121
     
    122
    123
     
    124
    125

    GNU Classpath is a free implementation of Java’s standard

    126
    library.  To execute Java programs, it is also necessary to have a
    127
    Java Virtual Machine (JVM). This component manages memory, enforces
    128
    security restrictions, compiles Java bytecodes to the instruction set
    129
    of your computer, and provides other runtime services.  There exist
    130
    several projects for . Most use GNU Classpath as the
    131
    up-stream source for their library.

    132
     
    133

    Java programs can also be compiled “ahead of time,”

    134
    like C++ or other compiled languages. The GNU Compiler Collection
    135
    (GCC) does this, and its Java library is mostly derived from GNU
    136
    Classpath.

    137
    138
     
    139
    140
     
    141
    142
     
    143
    144
    GNU Classpath is licensed under the GPL plus a special exception:
    145
     
    146
    147

    148
    149
    Linking this library statically or dynamically with other modules is
    150
    making a combined work based on this library.  Thus, the terms and
    151
    conditions of the GNU General Public License cover the whole
    152
    combination.
    153
    154

    155

    156
    157
    As a special exception, the copyright holders of this library give you
    158
    permission to link this library with independent modules to produce an
    159
    executable, regardless of the license terms of these independent
    160
    modules, and to copy and distribute the resulting executable under
    161
    terms of your choice, provided that you also meet, for each linked
    162
    independent module, the terms and conditions of the license of that
    163
    module.  An independent module is a module which is not derived from
    164
    or based on this library.  If you modify this library, you may extend
    165
    this exception to your version of the library, but you are not
    166
    obligated to do so.  If you do not wish to do so, delete this
    167
    exception statement from your version.
    168
    169

    170
    171
     
    172
    173
     
    174
    175
    Please check the FSF FAQ on the GNU GPL: .
    176
    177
     
    178
    179

    If you combine GNU Classpath with independent modules to produce an

    180
    executable you can copy and distribute the resulting executable under
    181
    terms of your choice.

    182
     
    183

    So you can use and distribute GNU Classpath as is in your program without changing the license of your software.

    184
    185
     
    186
    187
    Direct such questions to licensing@gnu.org. The FSF is the
    188
    official copyright holder of Classpath and sets the distribution terms
    189
    190
     
    191
    192
    The FSF has a GPL-compliance lab which offers consulting services for
    193
    companies who are working to develop products that incorporate Free
    194
    Software so that they can do so in ways that comply with the terms of
    195
    the GPL and other Free Software licenses. If you are interested in this
    196
    service, please write to compliance-lab@fsf.org.
    197
    198
    199
     
    200
    201
     
    202
    203

    See the

    204
    href="docs/">documentation page, especially the 
    205
    href="docs/hacking.html">GNU
    206
    Classpath Hacker’s Guide, and pick up a  from the list!
    207
    208
     
    209
    
             
    210
    implementations to get inspiration?">
    211
    If you are going to contribute source code to GNU Classpath we must
    212
    make sure that you have not studied the source code of the JDK/JRE or
    213
    decompiled any of its classes. Furthermore you must not have signed
    214
    any non-disclosure agreements with Sun or other companies in regard
    215
    with java technology that might cover the core class libaries or
    216
    tools. The reason for this requirement is that we want to make sure
    217
    that Sun or any other company cannot rightfully claim that GNU
    218
    Classpath infringes their copyright. You are therefore questioned
    219
    about your experience with other implementations of similar source
    220
    code and any agreements with companies you might have signed when you
    221
    request to contribute to GNU Classpath.
    222

    223
    Please note that this does not mean you cannot help GNU Classpath at
    224
    all in such a case. Here is a list of things you can do instead:
    225
    226
      
  • write Mauve test cases
  • 227
      
  • write example applications demonstrating the usage of the packages
  • 228
      
  • writing/fixing helper programs (like japitools) and scripts
  • 229
      
  • report bugs
  • 230
      
  • help fixing the documentation
  • 231
      
  • help in other related Free software projects
  • 232
      (e.g. virtual machine development,
    233
       )
    234
    235

    236
    Here are some rough guidelines for deciding whether or not it would be
    237
    wise to accept a contribution from someone that studied source code
    238
    for another implementation of the core libraries or is under contract
    239
    with some company covering implementations of core library classes.
    240

    241
    If the developer got access to the source code by signing some
    242
    contract (like the SCSL) with Sun then it would be best to examine
    243
    that contract (by FSF legal) before deciding.
    244

    245
    If the developer just accidentally saw some of the source code and had
    246
    no intention (and didn't actually) study the implementation (with the
    247
    intention of contributing to GNU Classpath) there is no problem.
    248

    249
    Studying a proprietary implementation with the intention of
    250
    implementing it (better) for GNU Classpath is a clear no-no.
    251
    The general rule is that if you have looked at or studied any
    252
    (proprietary) implementation of a package you should not work on that
    253
    package for GNU Classpath. That is because it would be
    254
    difficult to proof that you really did an independent
    255
    implementation. Since what you create might look very similar (which
    256
    is not unlikely). Working on something completely unrelated is OK (as
    257
    long as there are no contractual obligations with Sun or some other
    258
    company to not do this of course).
    259

    260
    The important thing is that we want to be clear on the fact that we
    261
    created an independent implementation. We don't want to get into
    262
    tricky legal situations. We want to avoid risking to go to court over
    263
    reverse engineering or clean room situation questions if not
    264
    absolutely necessary. That is why we in general just say "please don't
    265
    contribute if you looked at other implementations". If someone thinks
    266
    that their actions might be explained as copying directly or
    267
    indirectly another (proprietary) implementation then that could be a
    268
    problem that we want to avoid.
    269

    270
    FSF Legal will always advise not to take any unnecessary risks that
    271
    might endanger the (perceived) free software status of a GNU
    272
    project. (If we might need to go to court to proof that what we did
    273
    was OK, then don't!)
    274

    275
    This isn't a GNU Classpath project specific issue.
    276
    See 
    277
    url="http://www.gnu.org/prep/standards/html_node/Reading-Non_002dFree-Code.html">.
    278
    279
     
    280
    281
    Even if you have seen Sun's source and you cannot contribute code to GNU Classpath, there are still many way you can help us.
    282
     
    283
    Here's a few examples of contributions you can make that would greatly help us:
    284
    285
  • Mauve test cases
  • 286
  • Example programs for GNU Classpath
  • 287
  • Documentation fixes
  • 288
  • Help programs (e.g. japitools) and scripts
  • 289
    290
     
    291
    In general, if you just accidentally saw some of the source code and had no intention (and didn't actually) study the implementation (with the intention of contributing to GNU Classpath), there is no problem.
    292
     
    293
    In case of doubt, please refer to FSF legal.
    294
    295
     
    296
    297
    Some contributors of Classpath might be annoyed if their work was being
    298
    used under conditions that are not according to the terms of the license.
    299
    However, enforcing the license in court (if this was ever needed) would
    300
    be easier if the Free Software Foundation can claim to speak in the name
    301
    of all authors. For this reason, and for others that are specific to the
    302
    intellectual property system of the United States, GNU projects tend to
    303
    be a bit picky about getting signatures from all contributors. Please do
    304
    not see this as a personal offence.
    305
     
    306

    Giving the copyright to the FSF also gives us a clear paper trail where changes come from, which confirms our clean-room status.

    307

    308
     
    309

    310
    The assignment contract commits the foundation to setting distribution terms
    311
    that permit free redistribution.
    312

    313
     
    314

    315
    The assignment contract we normally use has a clause that permits you to
    316
    use your code in proprietary programs, on 30 days' notice.
    317
    (The 30 days' notice is there because, through a legal technicality,
    318
    it would improve our position in a suit against a hoarder.)
    319
    Although we believe that proprietary software is wrong, we include this
    320
    clause because it would serve no purpose to ask you to promise not to do
    321
    it. You're giving us a gift in the first place.
    322

    323
     
    324

    325
    You don't need to invoke this clause in order to distribute
    326
    copies as free software under the GNU GPL, since everyone is
    327
    allowed to do that.
    328

    329
     
    330

    See also http://www.gnu.org/licenses/why-assign.html.

    331

    332
     
    333

    For getting the assignment form, please send an e-mail with your name (as

    334
    it appears in your passport) and your current postal address to the
    335
    maintainer of GNU Classpath, Mark Wielaard .
    336

    337
    338
     
    339
    340

    Follow these steps to install GNU Classpath. Please note that you need this only if you want to work directly with it; usually JVMs contain a pre-packaged version of GNU Classpath.

    341
     
    342
    Prerequisites
    343
     
    344
    Please check the exact version of the prerequisites from your release's INSTALL file.
    345
     
    346
    In every case, you need:
    347
    348
  • GNU gmake
  • 349
  • GNU autoconf
  • 350
  • GNU automake
  • 351
  • GNU libtool
  • 352
    353
     
    354
    For building the Java bytecode (.class files), one of these compilers are required.  You can select which compiler using --with-jikes, --with-gcj or --with-kjc as argument to configure; the present default is gcj.
    355
     
    356
    357
  • GCJ (part of GNU GCC)
  • 358
  • IBM Jikes
  • 359
    360
     
    361
    For building the JNI native libraries, the following are required unless --disable-gtk-peer is used as an argument to configure.
    362
    363
  • 364
  • gdk-pixbuf
  • 365
    366
     
    367
    For building the documentation you will need:
    368
    369
  • texinfo
  • 370
    371
     
    372
    Install from CVS
    373
     
    374
    375
    376
    377
    378
    379
    380
     
    381
    Install a release
    382
    383
    ">
    384
      Download the current release
    385
    386
    387
      unpack
    388
    389
    390
    391
      make sure you have all pre-requirements
    392
    393
    394
      configure the distribution; use --help to get the list of options: you will usually need --prefix=dest/dir/for/classpath; use --disable-gtk-peer if you don't use gtk+/gnome.
    395
    396
     
    397
    398
    399
     
    400
     
    401
    402
     
    403
    404
     
    405
    406
    407
    password is anoncvs
    408
    409
    410
    411
    The main thing this does is creating the gnu/testlet/config.java. You could also do this by hand from the config.java.in file
    412
    413
    414
    Edit the script 'batch_runner' to set the variable COMPILER correctly
    415
      (there are a couple of example settings)
    416
    417
    418
    Edit script 'runner' to set the variable RUNTIME correctly
    419
      (there are a couple of example settings)
    420
    421
    422
    run ./batch_run and look at the results. You can also run individual tests with
    423
    - echo gnu.testlet.java.lang.String.getBytes | jamvm
    424
    gnu.testlet.SimpleTestHarness
    425
    (Option flags are -verbose and -debug)
    426
     
    427
    428
     
    429
    430
     
    431
     
    432
    433
     
    434
    435
     
    436
    When developing a JVM that uses GNU Classpath, a copy of GNU Classpath local to the JVM is often used. To keep the Classpath sources synchronized with the main development, a few approaches are possible (we assume here that you are keeping the local copy of Classpath in your JVM revision control software):
    437
    438
  • Use CVS import and CVS update as explained in of the CVS manual. This works well for minor changes, but has the disadvantage of a limited control on the update / merge of the sources. In fact, most of the developers prefer merging the changes by hand.
  • 439
     
    440
  • libgcj, which is almost always trying to be
  • 441
    as synchronized as possible with GNU Classpath CVS, has a script
    442
    that runs daily which produces a (colored) differences overview
    443
    (including patch/diffs). They also put in special markers into the
    444
    source for gcj specific changes that the script recognizes.
    445
    446
  • Script can be found at:
  • 447
    448
     
    449
  • Daily updated result:
  • 450
    451
    452
    453
     
    454
    455
     
    456
    457
    The file lib/standard.omit controls which files are omitted from the compilation. Add a regex with the files to be omitted and rebuild classpath.
    458
    459
     
    460
    461
     
    462

    To modify and upload GNU Classpath's web pages, you need write access to the CVS. First, checkout the modules "classpath" and "website".

    463
     
    464

    The web pages are stored in doc/www.gnu.org and are written in wml (Web Meta Language, see ).

    465
     
    466

    A typical page usually looks like this:

    467
    468
    \#include "include/layout.wml"
    469
     
    470
    <subject "here goes the page title">
    471
     
    472
    <box>
    473
     
    474
    <boxtitle>Section 1 Title<\boxtitle>
    475
    <boxitem>
    476
      section 1 contents
    477
    <\boxitem>
    478
     
    479
    ....
    480
     
    481
    <\box>
    482
     
    483
    484
     
    485

    Invoking "make" creates the html pages in the same directory. To copy those pages to another directory, use

    486
    487
    > export CLASSPATH_WEBROOT=...destination...
    488
    > make publish
    489
    490
     
    491

    The steps to publish the pages are:

    492
    493
  • Update ChangeLog
  • 494
  • Commit your changes in module Classpath to the CVS
  • 495
  • cd doc/www.gnu.org
  • 496
  • make
  • 497
  • copy the modified / new pages to the website module
  • 498
  • commit the changes in the website module
  • 499
    500
     
    501

    Note that it takes up to an hour for the pages to appear on the GNU website after an upload.

    502
     
    503
     
    504
    505
     
    506
    507
     
    508

    Only the proprietary VM's vendor can make it work with GNU Classpath, by the nature of the VM being proprietary. GNU Classpath provides well documented and widely used interfaces for interfacing with runtimes. It's up to proprietary VM vendors to make their products work with GNU Classpath, if they wish to do so. If you, as a customer, want the runtime to use GNU Classpath, please talk to your proprietary software vendor.

    509
     
    510

    You can also try using a free runtime that supports GNU Classpath out-of-the-box instead.

    511
     
    512
    513
     
    514
    515
     
    516
    517
     
    518
    519
     
    520
    Well consider what happens in a VM.  VMThrowable.fillInStackTrace() is
    521
    very fast -- it's just a chain of addresses.
    522
    VMThrowable.getStackTrace() is very slow, because it has to convert
    523
    all those addresses into StackTraceElements.  I suspect that you can
    524
    get the trace for the whole stack in less time than it takes to create
    525
    a single StackTraceElement.  For this reason, the vmState is stored
    526
    and lazily converted to a StackTraceElement[]. (Andrew Haley)
    527
     
    528

    A particular problem is posed by OutOfMemoryException: throwing it shouldn't require any memory (there's none anyway). Some propose that the VM should preallocate it at bootstrap, but this doesn't solve the problem. In Chris Gray's words "if several threads throw OOME at the same time, the stack traces can get mixed up [...snip...] This situation is less improbable than you might think, since if one thread encounters an OOM situation, all other threads should encounter one too. With some forms of co-operative multi-threading you may get away with it, but in the general pre-emptive case you could be living dangerously."

    529
     
    530
    531
    532
     
    533
     
    534
    535
    536
     
    537
    Beware: generating the complete API Documentation non-trivial and the generation of a full tree takes more then one and half hour (on a 1.4 Ghz Athlon),
    538
    150+ MB of memory, at least 25MB of tmp storage, and at least
    539
    twice so much in your obj build dir.
    540
     
    541
    542

  • set the CVS_RSH environment variable to ssh
  • 543

  • install gcj 3.3.2 (or higher)
  • 544
    545
    gjdoc CVS :ext:anoncvs@savannah.gnu.org:/cvsroot/cp-tools module gjdoc
    546
    547

  • install libxmlj
  • 548
    549
    libxmlj CVS :ext:anoncvs@savannah.gnu.org:/cvsroot/classpathx module libxmlj
    550
    make && make install
    551
    552
     
    553

  • For gjdoc add at the start of gnu/classpath/tools/gjdoc/Main.java (main):
  • 554
     
    555
    556
      System.setProperty("javax.xml.transform.TransformerFactory",
    557
                "gnu.xml.libxmlj.transform.TransformerFactoryImpl");
    558
    559
     
    560

  • There is a ant build.xml file, but you can also compile it all by hand together with the external/jaxp/source files from Classpath which can be copied in the src direcrory as follows:
  • 561
     
    562
    563
      find * -name \*.java | xargs gcj -O2 -g -o gjdoc \
    564
      --main=gnu.classpath.tools.gjdoc.Main
    565
    566
     
    567

  • Create a simple gjdoc script and put it in your PATH:
  • 568
     
    569
    570
      #!/bin/sh
    571
      CLASSPATH=/home/mark/src/libxmlj:/home/mark/src/gjdoc/src/resources \
    572
      LD_LIBRARY_PATH=/usr/local/libxmlj/lib \
    573
      /home/mark/src/gjdoc/src/gjdoc $*
    574
    575
     
    576

  • Configure classpah with --enable-gjdoc.
  • 577

  • Type make and go get yourself some coffe, take a shower and do some work in the garden.
  • 578
    579
     
    580

    There is one catch. The above setup is completely broken for some HTML

    581
    entities (see [bugs #4823] HTML entities such as auml and nbsp should be
    582
    put back in the API doc). So if you have  spectacular and mysterious
    583
    crashes then make sure that your java source files don't contain such
    584
    entities.
    585
     
    586
     
    587

    Alternatively, you may also try the following command (the one used to generate the doc on ):

    588
    589
    590
    $(GJDOC) -public -use \
    591
            -sourcepath "$(sourcepath)" \
    592
            -encoding UTF-8 \
    593
            -breakiterator \
    594
            -licensetext \
    595
            -linksource \
    596
            -splitindex \
    597
            -d html \
    598
            -doctitle "GNU Classpath $(VERSION)" \
    599
            -windowtitle "GNU Classpath $(VERSION) Documentation" \
    600
            -header $(classpathbox) -footer $(classpathbox) \
    601
            -subpackages java:javax:org
    602
    603
    604
     
    605
    606
    607

    powered by: WebSVN 2.1.0

    © copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.