• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Java Command

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It�s a simple ask.. I can�t run a java file in my DOS System...I need to test my command lines in java like: Java CommandArgsThree 123...I hava the J2sdk1.4.2_02 installed in my computer with the enviroment variable:
JAVA_HOME=c:\j2sdk1.4.2_02
what is wrong??
Could I run a aplication java setting my own lines of command in eclipse or JCreator?
please answer me something!! :roll:
Obrigada!
 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Liza,
I also had this problem initially. It had everything to do with my path settings, and my classpath settings. I'll give you an explanation of what I did on my windows2000 laptop to get things going.
Open cmd prompt and type path <enter>
verify that the path to the JDK is in there... C:\j2sdk1.4.1_02\bin
if not, you may set it by typeing set Path=.........
OR
right click my computer, properties, environmental variables.
ensure that something like the following is included in the PATH variable (if not edit it) C:\j2sdk1.4.1_02\bin . Keep in mind that entries are separated by semicolons.
Then open a cmd prompt, and move to a directory where your java file lives. Then compile it...
Now, if you can compile, but when you java TheFile... and you get an error... this may be due to the ClassPath setting. Open up a cmd prompt, make sure your in the root directory, and type in set ClassPath= <enter>
Yes, you just cleared out the classPath. This is what allowed me to execute the class files. Before that I was getting 'no such method, main' errors when there was absolutely a main method.
Hope this helps, it came from the Java2 Bible.
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic