• 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

Packages and Executables

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My environment is Windows 98. I installed java in the c:\jdk 1.2.2 directory with a path for this directory in autoexec.bat.
Most of my source and class files are in a directory name c:\java, so I presume this is my default directory. When I want to run an application, I just type in the command "java classname" from this directory.
I have a subdirectory under java called testdir. I created a source file called Forest with a package statement "package testdir;" at the beginning of the file and compiled it from this subdirectory so my class files are now in c:\java\testdir.
I can't get the program to run under the c:\java directory with the command "java Forest" or under the c:\java\testdir directory with the same command. Judging from the error messages, the loader is looking for a file named testdir/Forest, so I tried using "java testdir/Forest" and that works under the c:\java directory. Isn't the forward slash a Unix naming convention for directories? Can anyone explain what is going on here?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is a bit strange. My guess is that there's some code that they developed on Solaris which they neglected to change in the Windows version. However, try "java testdir.Forest" instead - that should work, and is platform-neutral.
 
Betty Reynolds
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jim. That worked.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dear friends ,
pl help me out
following message is there "java.awt.event not found on import"
(i am using jdk 1.2.1 ),when i try to import event package,...
i have also tried to use package class to find what packages are available
but again the message "package class not found " is there.
how can i know what packages are there ? pl tell me
thanks
samar
 
Jim Yingst
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Samar- I answered here.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic