This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Run project java with javac Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Run project java with javac" Watch "Run project java with javac" New topic
Author

Run project java with javac

Rogerio Lima
Greenhorn

Joined: Feb 08, 2009
Posts: 3
I'dont get to run my java project with javac ...
Someone can help me ???
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11168
    
  16

javac compiles your java source code into bytecode. to run your program, you would then run it with the java command.

for example:

javac MyClass.java

to compile, and then
java MyClass

to run


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Rogerio Lima
Greenhorn

Joined: Feb 08, 2009
Posts: 3
OK ... But, it's impossible, I write this code but don't run ...
What I need to do for this run ???
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
What do you mean by "don't run"? What -exactly- are the commands you're using for compiling and running? What happens - are there any error messages?


Ping & DNS - my free Android networking tools app
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11168
    
  16

it is not impossible. people write and run java programs every day.

Does your code compile? what is the EXACT output when you type

javac <YourClassName>.java

There are dozens of reasons why this may not work, but nobody can help you unless you tell us the problem. There may not even BE a problem here - it may be when you try an run the code. In either case, the info it prints is critical in solving the issue.

If you expect someone to help you SOLVE the problem, you have to tell us what the problem IS.
Rogerio Lima
Greenhorn

Joined: Feb 08, 2009
Posts: 3
Ok guys ... I was whith a problem for compile my projects in java with compiler javac ... Now I resolved this problem ... I installed the JDK incorrect ... I already installed the correcty ... Thanks a lot for your help ... I sorry for I didn't exatly my problem ... Regards everybody ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Run project java with javac
 
Similar Threads
How to compile only specific .java files, not the whole src
Error when using JDOM
Eclipse/Ant: package javax.servlet does not exist
Cannot compile in 1.5
Args in Netbeans