• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

call an other class in the same package

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I have 2 classes,classA in which I want to run un othor classB (in the same package)when i click on a bouton in the classA.

This is the message that I get when I try to execute my code for classA:



this is my code:


I have 2 classes,classA in which I want to run un othor classB (in the same package)when i click on a bouton in the classA.

This is the message that I get when I try to execute my code for classA:

command output:
Erreur : impossible de trouver ou charger la classe principale C:\Users\Lenovo\Documents\NetBeansProjects\Admin\build\classes\admin\tatou\Tat.class
this is my code:

my code:

this is classA


This is classB



thanks for any help
 
Rancher
Posts: 3742
16
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What command line do you use to start your program ?
Now compare that to the command line you use in your program to start the second program.

Also, you are not reading the standard output from the Process you create. Look carefully at line 69.
And even if it were, the while loop you are using to print the error and standard output is flawed. The readLine method blocks, so if all your output went to only one of the streams, nothing would be printed out.
Either use ProcessBuilder which allows you to redirect them both to the same stream, or use separate threads to handle each output stream.
reply
    Bookmark Topic Watch Topic
  • New Topic