• 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

Running a Swing program.

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to learn more about Swing / GUI so I am using the sum.com page going through there tutorial. I compiled there first program then tried to run it using command prompt... c:\java HelloWorldProgram
ofcourse, I got an error... Looked in suns running a swing program section and found the following that will run the program...

java -classpath ;C:\java\1nfdir\new1nf.jar HelloWorldSwing

the above works... the question is can I somehow set this classpath so I don't have to type that in all the time... just use java HelloWorldApplication etc...

Thankyou,

Pete
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure what C:\java\1nfdir\new1nf.jar refers to. I'd say the problem lies in your error message that you didn't show us. If you are running a java program that just uses the standard Java API then there is no need to specify the classpath.

Why don't you start by showing us the error message you received and then we can go from there.
 
Pete Tyo
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry,should have posted the error. Needless, to say I typed
C:\java HelloWorldProgram

and the dang thing worked.. Not really sure what happened, but for now I suppose there is no problem anymore..

Thanks anyway,

Pete
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic