• Post Reply Bookmark Topic Watch Topic
  • New Topic

cant compile my source files  RSS feed

 
morgan mulholland
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to compile my source files into the bin folder but i cant seem to do it i keep getting an error saying
"javac: no source files
usage: javac <options> <source files>"

my code looks like this

"@echo off
title Arcanescape - Compiler
cd "C:\Users\Morgan Mulhollandf\Desktop\new rsps\StarterPack_RuneLocus\Client"
javac -d bin -sourcepath "src"
pause"

i have attached a screen shot to this to show you how my "client" folder is set up ,

please help




folder-setup.png
[Thumbnail for folder-setup.png]
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
morgan mulholland wrote:I'm trying to compile my source files into the bin folder but i cant seem to do it i keep getting an error saying
"javac: no source files
usage: javac <options> <source files>"

my code looks like this

"@echo off
title Arcanescape - Compiler
cd "C:\Users\Morgan Mulhollandf\Desktop\new rsps\StarterPack_RuneLocus\Client"
javac -d bin -sourcepath "src"
pause"

i have attached a screen shot to this to show you how my "client" folder is set up ,



The compiler is complaining that you didn't name any java files to compile... it's nice that you provided the source directory, and the target directory, but you actually have to tell it the name of the java file too.

Henry
 
morgan mulholland
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but there's a lot of .java files in the src folder
src-folder-set-up.png
[Thumbnail for src-folder-set-up.png]
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
morgan mulholland wrote:but there's a lot of .java files in the src folder



And if you specified any of them in the command line, I am sure that the java compiler would try to compile them.

Henry
 
morgan mulholland
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So if i just specify one of them it will compile all of them ?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
morgan mulholland wrote:So if i just specify one of them it will compile all of them ?


<sarcasm>
Seriously??? that's how you interpreted my last response? If you were to design the java compiler, is that how you would do it? ...
</sarcasm>

Okay, here is a more serious answer... No. The compiler will only initially compile what you tell it to compile. However, if during compilation, it encounters a need for a class file, but the class file that it finds is older than its matching java file, then it will compile that too.

Henry
 
morgan mulholland
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i really have no idea what im doing here , im sorry but i downloaded this src and compiler as a starter pack and i cant get the compiler to run when i first got the compiler it looked like this

"@echo off
title Client - Compiler
javac -d bin -sourcepath src
pause"
 
morgan mulholland
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any chance you could write the code needed for the compiler so i could copy it in because iv tried specifying a java file in the compiler and im just getting the same error
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
morgan mulholland wrote:Is there any chance you could write the code needed for the compiler so i could copy it in because iv tried specifying a java file in the compiler and im just getting the same error


Well, what have you tried? Keep in mind that the ranch is a learning site, asking for something to do it for you (no matter how easy it is) is not the preferred path to a solution.

Henry
 
morgan mulholland
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's true, i think i may have got it to work thanks a lot for the help
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done, and welcome to the Ranch

Note the javac tool works by the old Unix conventions: no output ⇒ everything worked OK. You only get any messages if there is an error.
We have an FAQ which might be helpful.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!