Visualizzazione dei risultati da 1 a 5 su 5

Discussione: [java] jdk 1.1

  1. #1

    [java] jdk 1.1

    E' possibile con il J2SDK 1.4.1 compilare solo con le classi del JDK 1.1?
    Oppure è possibile installarli tutti e due e decidere dopo con cosa compilare?

  2. #2
    Ho scoperto che c'è una opzione -target, ma non riesco ad usarla... Qualcuno l'ha mai vista?

  3. #3
    Utente di HTML.it
    Registrato dal
    Feb 2002
    Messaggi
    1,798
    estratto dalle tool/doc reference di java:
    Cross-Compilation Options
    By default, classes are compiled against the bootstrap and extension classes of the platform that javac shipped with. But javac also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation. It is important to use -bootclasspath and -extdirs when cross-compiling; see Cross-Compilation Example below.


    -target version
    Generate class files that will work on VMs with the specified version. The default is to generate class files to be compatible with the 1.2 VM in the Java 2 SDK. The versions supported by javac in the Java 2 SDK are:

    1.1
    Ensure that generated class files will be compatible with 1.1 and VMs in the Java 2 SDK.
    1.2
    Generate class files that will run on VMs in the Java 2 SDK, v 1.2 and later, but will not run on 1.1 VMs. This is the default.
    1.3
    Generate class files that will run on VMs in the Java 2 SDK, v 1.3 and later, but will not run on 1.1 or 1.2 VMs.
    1.4
    Generate class files that are compatible only with 1.4 VMs.

    ciao.
    Slack? Smack!

  4. #4
    L'avevo trovato anch'io, ma non riesco a farlo funzionare... Mi viene il dubbio che con tutti questi problemi che ho riscontrato, forse devo cambiare JDK.

  5. #5
    Utente di HTML.it
    Registrato dal
    Feb 2002
    Messaggi
    1,798
    Naturalmente la tua applicazione deve utilizzare solamente classi e package relativi ad una ben precisa versione del kit di sviluppo.

    Se vuoi compilare per jdk 1.1 per esempio usa:
    > javac -target 1.1 <classe>

    ciao.
    Slack? Smack!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.