bonjour,
j'ai 2 packages:
bateau comprenant une class navire
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
package bateau;
 
/**
 *
 * @author jm18c
 */
public class navire {
    public static void affiche(){
        System.out.println("ceci est un bateau");
    }
 
}
et transport comprenant le main et une classe Transport
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 */
package transport;
import bateau.*;
/**
 *
 * @author jm18c
 */
public class Transport {
 
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    navire.affiche();
    }
 
}
sous netbean cela s'exécute mais en commande en ligne
je compile navire
je compile Transport et là j'ai
Transport.java:7: error: package bateau does not exist
import bateau.*;
^
Transport.java:18: error: cannot find symbol
    navire.affiche();
    ^
  symbol:   variable navire
  location: class Transport
2 errors
je ne comprend pas
merci