Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Is There A Way To Use Command Prompt Commands?, To make a program execute cmd stuff
beeseven
post Dec 1 2005, 12:56 AM
Post #1


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



I looked in the System class because that would make the most sense, but I didn't see anything.

In C++ it's system(stuff) in stdlib.h. Just looking for something like that.
Go to the top of the page
 
+Quote Post
Inspiron
post Dec 1 2005, 05:03 AM
Post #2


Trap Grand Marshal Member
***********

Group: Members
Posts: 1,203
Joined: 25-March 05
Member No.: 4,883



If you are trying to compile and execute a java application, try these...

Compiling Java source to class
... Assuming your source java file is "xyz.java"
CODE
C:/>javac xyz.java


Executing Java class application
... Assuming your source java file is "xyz.java"
CODE
C:/>java xyz

Note that when you execute a java application, you need not enter the extention of your application file.

For more Java parameter options
CODE
C:/>java /?



Java Notes
xyz.java ---> Java Source Code file
xyz.class ---> Java compiled application file (similar to common *.exe file)
xyz.jar ----> Java Archive file (package of classes, images, music, similar to executable *.zip file)
Go to the top of the page
 
+Quote Post
no9t9
post Dec 1 2005, 07:21 AM
Post #3


Privileged Member
*********

Group: Members
Posts: 773
Joined: 4-November 04
Member No.: 2,118



I think the guy is asking about a way to get to the shell command using Java. I don't know Java that well but I'm sure if you Google Shell or command line with Java, you'll find something.

Even if there is something like this, it is more than likely the server or the client will not give permission to execute this. I know PHP has a shell command but most servers restrict the use of this command. If you don't have permissions, then it is pretty much useless.

The resaons for restricting permission on a command like this is obvious. To prevent hackers from doing something bad to the server.
Go to the top of the page
 
+Quote Post
beeseven
post Dec 2 2005, 12:18 AM
Post #4


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



I know how to compile and run from command line, no9t9 was right that I want to do it inside a program.

Don't really care about the permissions, I mostly just want to use it on my own machine for certain things. Though if I ever needed it, one of my friends has some control over one of the servers I use primarily in case it's not already enabled.
Go to the top of the page
 
+Quote Post
beeseven
post Dec 2 2005, 12:26 AM
Post #5


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



Sorry about the double post, but some research and asking around has revealed the answer, for anyone who wants it.

http://www.devdaily.com/java/edu/pj/pj010016/pj010016.shtml

It seems kind of complicated. Also can detract from compatibilty, which is normally one of Java's strongest points.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Auto Run Java Program(11)
  2. Java Basic Program Guidance(6)
  3. Execute Action In Java Web App(2)
  4. Ajax: Achieve Ajax Program In 5 Lines Of Code!(1)
  5. Eclipse Exporting .jar Files(5)
  6. Helpful Registry Edit For Java Programmers(3)


 



- Lo-Fi Version Time is now: 12th October 2008 - 05:33 AM