This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about compiling a java file with javac

 
Gurlok Kaiser
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy Guys, I'm new here, both as user and with java (well to be honest i don't know anything about java) I would like to ask a question: i found the source code of a class i'm interested to edit a bit (the ExternalDeoder.class of the Jpcsp emulator written in java which some of you may know about it). I added a line to the ExternalDecoder.java file, but when i try to compile it with javac i encounter a bunch of errors (they are about 100), as from what i can read in the promt there are 2 kinds of errors: "cannot find symbols" and "method does not override or implement a method from a supertype". What i would like to ask is: Since i'm a complete ignorant regarding programming and java, Can I compile the .class file from the ExternalDecoder.java file only, or do I need ALL the src files related to it?
 
Henry Wong
author
Marshal
Pie
Posts: 21117
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gurlok Kaiser wrote:Hy Guys, I'm new here, both as user and with java (well to be honest i don't know anything about java) I would like to ask a question: i found the source code of a class i'm interested to edit a bit (the ExternalDeoder.class of the Jpcsp emulator written in java which some of you may know about it). I added a line to the ExternalDecoder.java file, but when i try to compile it with javac i encounter a bunch of errors (they are about 100), as from what i can read in the promt there are 2 kinds of errors: "cannot find symbols" and "method does not override or implement a method from a supertype". What i would like to ask is: Since i'm a complete ignorant regarding programming and java, Can I compile the .class file from the ExternalDecoder.java file only, or do I need ALL the src files related to it?


No. You don't need all the source files to compile. However, you do need the dependent classes and jar files -- which is the same need when you run the program.


And BTW, welcome to the ranch...
Henry
 
Gurlok Kaiser
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see, Thanks for the reply (and for welcoming me aswell). So, to compile that file, how should i order all the classes files and jar ones? I mean if i should put them together in a random folder, or if i should follow the folders order and structure?
 
Henry Wong
author
Marshal
Pie
Posts: 21117
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gurlok Kaiser wrote:I see, Thanks for the reply (and for welcoming me aswell). So, to compile that file, how should i order all the classes files and jar ones? I mean if i should put them together in a random folder, or if i should follow the folders order and structure?


Jar files must be specified in the classpath. Class files must be ordered in directory paths related to what package they are in. And the root of the directory path must be specified in the classpath.

See the tutorial on classpaths for complete details.

http://docs.oracle.com/javase/tutorial/essential/environment/paths.html

Henry
 
Gurlok Kaiser
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well just two minutes ago after so many attempts i finally compiled what i tried to do (well i had to compile the whole package instead of doing only the wanted file, but since i'm a newbie i can't complain at all). Thanks for the help Henry Wong
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic