How to compile ALL java files in OR UNDER a given directory?
G'Day Folkies,
At face value, TikeSwing looks like the money shot for enforcing MVC in my version of minesweeper http://forum.java.sun.com/thread.jspa?forumID=54&threadID=5248903
I'm attempting to build the "Hello World" example which comes with TikeSwing.
http://www.javaworld.com/javaworld/jw-06-2005/jw-0620-tikeswing.html
It compiles ok
C:\Java\lib\tikeswing-1.5\example\src\fi\mmm\hello>javac -d C:\Java\home\classes -cp C:\Java\lib\tikeswing-1.5\src;C:\Java\lib\tikes
wing-1.5\lib\commons-beanutils.jar;C:\Java\lib\tikeswing-1.5\lib\commons-lang-2.0.jar;C:\Java\lib\tikeswing-1.5\lib\commons-logging.
jar;C:\Java\lib\tikeswing-1.5\lib\log4j.jar;C:\Java\lib\tikeswing-1.5\example\src;. HelloApplication.java
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
But it doesn't run
I presume that javac isn't detecting all dependancies, presumably because Tike "decouples M from V from C" using reflections.
C:\Java\lib\tikeswing-1.5\example\src\fi\mmm\hello>java -cp C:\Java\home\classes;C:\Java\lib\tikeswing-1.5\lib\commons-beanutils.jar
;C:\Java\lib\tikeswing-1.5\lib\commons-lang-2.0.jar;C:\Java\lib\tikeswing-1.5\lib\commons-logging.jar;C:\Java\lib\tikeswing-1.5\lib\
log4j.jar;C:\Java\lib\tikeswing-1.5\example\src;C:\Java\lib\tikeswing-1.5\src;. fi.mmm.hello.HelloApplication
Exception in thread "main" java.lang.NoClassDefFoundError: fi/mmm/yhteinen/swing/core/component/YFrame
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at fi.mmm.hello.HelloController.<init>(HelloController.java:8)
at fi.mmm.hello.HelloApplication.main(HelloApplication.java:8)So, Please, is there a way of telling javac to just build *.java in or under C:\Java\lib\tikeswing-1.5\src\ ... regardless of dependencies?
Thanking You for any thoughts. Keith.
FYI.... Here's the quick and dirty, slower than a wet week, ugly, but effective batch script
set TIKE=C:\Java\lib\tikeswing-1.5
set SRC=%TIKE%\src
set LIB=%TIKE%\lib
set CLASSPATH=%LIB%\commons-beanutils.jar;%LIB%\commons-lang-2.0.jar;%LIB%\commons-logging.jar;%LIB%\log4j.jar;.
FOR /R %SRC% %%f IN (*.java) DO javac -d C:\Java\home\classes -cp %CLASSPATH% %%f
@ECHO OFF
REM http://www.robvanderwoude.com/ntfor.html
REM Walks the directory tree rooted at [drive:]path, executing the FOR statement
REM in each directory of the tree. If no directory specification is specified
REM after /R then the current directory is assumed. If set is just a single
REM period (.) character then it will just enumerate the directory tree.I can't figure out how do the equivalent of javac `dir /s /b *.java` (ie: cmd doesn't seem to have a built-in facility for expanding the results of a command into the command line) which would be a lot quicker and cleaner.
Cheers all. Thanx for the help. I appreciate it.
Similar Messages
-
Hi All,
I am extending a seeded CO and when I try to compile it in JDev , it asks for many class files the seeded CO imports.
I have copied all those imported files to my local system and when I try to compile , it still throws an error that some class files used by the classes imported in seeded CO are missing. Now this goes on and on. ( Seems entire server needs to be on my local system).
Now I decided to port the custom CO to server and compile it there. Even this seems to be a hard task for me as the javac command is not working on the server. It throws following exception
Exception in thread "main" java.lang.ClassFormatError: com.sun.tools.javac.main. Main (erroneous method access flags)......................................
Pls suggest how to compile a java file , as downloading entire server classes is a herculean task for me.
Thanks,
SrikanthHi Avajain & D.Ram ,
Thanks for the reply.
I have downloaded around 70 dependent class files to local system. Now the CO is getting compiled correctly.
I am extending a region level controller in Payroll page where in I have to default the salary to a predefined value.
This field is having a VO attribute to it. Now can I go ahead and set a value to the MessageTextInput or should I extend the VO to replace the desired value in the place of already queried value.
Thanks,
Srikanth -
How to compile a java file which is in memory?
how to compile a java file which is in memory?
such as:
String s="class MyClass {....}";
how to compile the string?
thxcome on ...That was a perfectly valid solution.
Do you know how to call the sun.* compiler? If not then search the forums for it. If that interface still exists (which it might not in newer versions) you then will create a string stream from your class and pass it to that. -
How to compile a java file in J9 for windows mobile 5.0
I have downloaded J9 for windows mobile 5.0 and need help on how to compile a java file.
You can compile your source code using J2SE ;)
may be this is important for you:
http://awareness.ics.uci.edu/~rsilvafi/pocketPC/index.
html
Regards!!!Actually i am using some eSWT related classes also.. so is there any way to compile from the J9 environment using J9 console.. -
How to compile a java file(Servlet) in J2EE v1.3.1
This is my first time using J2EE instead of J2SE!!HOw to compile a java file in J2ee\bin because there is no javac in j2ee and when i compile in J2se i got
G:\j2sdk1.4.1_01\bin>javac HelloServlet.java
HelloServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
This mean it doen;t support servlet in J2se!!so how can /what command to compile a servlet java file in j2ee.ThanksYou'll need to add the j2ee.jar to your classpath. Usually you'll have to add some jars from your app server to your classpath as well.
For example (using weblogic):
javac -classpath c:\java\j2ee\j2ee1.3.1\lib\j2ee.jar;c:\tools\appserver\weblogic\wl7.1\lib\weblogic.jar
HelloServlet.java -
How to compile a java file Dynamically !!!!
Hi all
The problem is
I have a dynamically created java file ,and i want to compile that file dynamically itself. The file name is stored in a string,
I am using ECLIPSE editor..
How do i compile this java file (which is stored in a string) dynamically?
Pls help me, already wasted a lot of time,
Thanks in advanceIn every Tutorial regarding Dynamic Compilation,
It is told to import javax.tools.*..
But i cannot find this package
I am using jdk1.4, is this the reason?
Actually the following packages are needed fro this
import javax.tools.DiagnosticCollector;
import javax.tools.JavaCompiler;
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;
but i cant finad any..!!!
Please help me -
How to compile a java file in a java program
Hi,
I don't know to compile a java file in a java class.
Could somebody help me?
Thanks.if ur using windows...
goto ur directory and then type
javac FILENAME.java
and ur done! -
How to compile other java files and run them from my own programs?
I'm developing a unit testing tool for AspectJ, which can originally generate the stubs for aspect unit to be tested. All these stubs are java files. After generation of stubs, how can I program the code to compile this unit together with these stubs, i.e. how can I put the functionality of compilation and run, e.g. command "javac *.java" and "java *", into my own code.
Hope you can understand what I mean.
Thank you in advance.When I use Runtime.getRuntime().exec(command) for executing the AspectJ compile command "ajc", "IOException createProcess error=2" always occurs, while it is ok for Java comiple command "javac".
Why this happens when I use Runtime.getRuntime().exec("ajc Hello.java Test.aj")? Is it the reason that Runtime.exec(String) may not support any command in DOS?
(ajc is the compile command for the java file and aj file.)
Thank you in advance. -
HOW TO INSTALL JDK1.4 ON LINUX PALTFORM AND HOW TO COMPILE A JAVA FILE
SIR PLZ KINDLY TELL ME THE PROCDURE OF INSTALL JSDK1.4 ON LINUX .
1.I HAVE DOWNLOADED IT ONA I HAVE INSTALL IN
/usr/local
but
2: do nt know how set the CALSSPATH and JAVA_HOME(ENV VARIABLES)
3:HOW TO COMPILE AND RUN THE JAVA FILE(JSP)2.
export JAVA_HOME=/usr/local/jdk1.4.0
export CLASSPATH=.
(amending for your set up.)
Placing these in your /etc/profile file will make them run automatically on log in of a user.
3.
You need tomcat, probably, http://jakarta.apache.org.
Bhav -
How to Compile Servlet Java Files
hello ...
i am a beginner at JSPs and java servlets ... i have been searchin' hopelessly for the past couple of days. Could someone please guide me on how to compile source files for servlets ... namely how can i include the packages javax.servlet.* since the compiler gives me an error that there is no class name ... I am using jdk1.3
Do I need to get the java server development kit ... but i cant seem to find it any where on the sun's site ... and do i need to download the j2ee sdk too ...
As you can gather that i am completely comfused and lost ... After doing programmin with asps and previous java experience, i had thought that the migration to a java platform on would be a breeze but the lack of any solid documentation which addresses the above questions is dampenin my spirits ... and the cryptic documentation with tomcat doesnt help either. :)
pleaze reply soon ... i have to implement a project for my company ... otherwise i would have to put servlets and jsp back in the closet and return back to asp.Try http://java.sun.com/j2ee/docs.html specifically, the links on that page called Download Instructions, Installation Instructions, Java Servlets Tutorial and JavaServer Pages QuickStart Guide
By the way, J2EE SDK's reference implementation is based on Tomcat itself but is more than a web container. -
How to compile this java files ?
I have two files Foo.java & Foo2.java in separate packages.
PLEASE let me know how to compile these files .
package XYZ;
public class Foo {
public static void main(String[] args) { }
package XYZ.ABCD;
class Foo2 extends Foo{
public static void main(String[] args) { }
}I'm getting .. following error.
XYZ\ABCD\Foo2.java:3: cannot find symbol
symbol: class Foo
class Foo2 extends Foo{
^
1 errorYou need an import statement in Foo2.java.
import XYZ.Foo;This should come before the package statement. -
How to compile a java file to class with class
There is a java file.
And i want to compile it with class, not javac command.
so i can catch the compile errors.
how to do it?
special thanks.http://java.sun.com/developer/JDCTechTips/2003/tt0722.html#2
-
How to compile a java file with specified jdk version in a program???
hi,
if we want to compile a program in another program with a particular
jdk version as an option, how to do that,plz reply and with example.Hi,
To compile from a program, read this (I've never tried, but I think it
will work):
http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Compiler.html
To get the jre version:
System.getProperty("java.version");
To get the vm version:
System.getProperty("java.vm.version");
Other properties at:
http://java.sun.com/j2se/1.4.1/docs/api/java/lang/System.html
Hope it helps,
ANeto -
Compile one by one, or all .java-files at once?
I just wanted to know if i have to, or if i can compile all java-files from a package, at the same time, or if i can compile first one file, and then the next.
I ask, because till now i only tried java-applets with 1 .java-file...but now i am doing a bigger project, but i just don't get it to work =((...it won't even compile....so i hope u can help me...
thx, ur Kayif i allready compiled something of my package...and i want to use those classes, which allready exist....can i include or import them?....i mean....i only want to compile my main-class again..my main .java-file i mean....do u know how to do that?
-
How to Use SDK compile all MXML file in project ?
Who can teach me ? Plz
1.How to Use Adobe SDK to compile all MXML file in project ?
2.How to Use Ant to compile all MXML file in project ?
Thanks everyone !!Thank you first!
Yes,you are right,since I am new to illustrator,and I want to try to write a plugin,
I have read the sdk doc and API and opened the sample in vs2010,but no idea about how to operate the pdf doc in illustrator with api.
Hope more advise or any examples,thank a lot.
Maybe you are looking for
-
My iPhone 4 with iOS 6 is making me start to hate Apple. Any App and at any time I open and I can not view it or move for more than 2 minutes, they close themselves. During connections, it also gives this problem and the signal disappears after a few
-
TV Series Pages cause iTunes 10.4.1 to crash
Whenever I connect to a TV Series page with more than 18 episodes in the iTunes store, iTunes 10.4.1 crashes without any error messages. Anyone seen this issue? I can duplicate the issue repeated using the any season of the TV Series "Bones", as well
-
I ad selections to my wish list...but when I go to home and under quick links, My Wish List is not there????
-
.PDFs are Rotating to Landscape & Printing On 1/ 2 of Page (updated)
[editted 9/4/13 for clarity and image] I have the same 9 Standard on two laptops. No printing problems at all on one laptop (Vista OS) but on the other (Windows 7), all .pdf documents are printing turned to landscape mode with the document printe
-
My video file is .avi I can play it with quick time but when dragging it into itunes, it came flied back to where it was.