Javac classpath ignored

I'm trying to run javac 1.5.0 in Cygwin but it seems to ignore the classpath I pass in,
so I get "package does not exist" error. Any ideas?
Here's my command:
/cygdrive/c/Program\ Files/java/jdk1.5.0_04/bin/javac \
-verbose \
-d classes \
-classpath .://filer/home/doog/src/adsenseapi/google3/java \
-sourcepath . \
ErrorCode.javaHere's part of the verbose output (formatted pretty):
search path for class files:
[c:\Program Files\java\jdk1.5.0_04\jre\lib\rt.jar
c:\Program Files\java\jdk1.5.0_04\jre\lib\jsse.jar
c:\Program Files\java\jdk1.5.0_04\jre\lib\jce.jar
c:\Program Files\java\jdk1.5.0_04\jre\lib\charsets.jar,
c:\Program Files\java\jdk1.5.0_04\jre\lib\ext\dnsns.jar
c:\Program Files\java\jdk1.5.0_04\jre\lib\ext\localedata.jar
c:\Program Files\java\jdk1.5.0_04\jre\lib\ext\sunjce_provider.jar
c:\Program Files\java\jdk1.5.0_04\jre\lib\ext\sunpkcs11.jar]
//filer7/home/build/google3/java/com/google/common/base/ThrowableFormat.java:8: package javax.servlet does not exist
import javax.servlet.ServletException;
                    ^The ServletException class is at ./javax/servlet/ServletException.class
Before that I tried putting servlet.jar in the current directory,
and I've also tried pointing to j2ee.jar which holds javax.servlet

Are you certain? I tried semicolon prior to posting the message. That gives a "no source files" error right at the semicolon:
javac: no source files
Usage: javac <options> <source files>
./compile-errormessages: line 5: //filer/home/doog/src/adsenseapi/google3/java: is a directoryI'm fairly certain that Cywin uses Unix separators, since it also uses forward
slash instead of backslash.

Similar Messages

  • Javac classpath problem

    I get this error when trying to compile a simple program:
    # javac -classpath .;/mnt/bdrive/MyData.class Test.java
    javac: no source files
    Usage: javac <options> <source files>
    where possible options include:
    ***snip***
    bash: /mnt/bdrive/MyData.class: Permission denied
    It seems to be a problem with specifying more than one thing for the classpath. If I remove the ".;", it works. (I don't need the . in the classpath but I should be able to specify it)

    probably :)
    I originally had just the path and was trying it different ways. If I use just the path instead of the permission denied message, I get this:
    bash: /mnt/bdrive/: is a directory

  • Javac -classpath / -sourcepath does not work ?

    when i call javac in the current directory (where the java source files within subdirectories for package names) the compilation works. but when i go one directory up and want to use the -classpath or the -sourcepath options, i just get errors:
    D:\TEMP\Java>javac -classpath ./examples test/HelloWorld.java
    error: cannot read: test/HelloWorld.java
    1 error
    D:\TEMP\Java>javac -sourcepath ./examples test/HelloWorld.java
    error: cannot read: test/HelloWorld.java
    1 errorRunning javac in the directory D:\TEMP\Java\examples works ...

    nope, the doc for javac clearly says:
    "If the -sourcepath option is not specified, the user
    class path is searched for source files as well as
    class files. "
    (see
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/ja
    ac.html#options)Yes but this is in reference to dependent classes, as the page you referenced explains.
    The basic format of javac isjavac source_fileIf the source file needs other user classes, then the classpath is searched for either .class files or .java files.

  • Java versus javac classpath

    hi everyone:
    this is a bit embarassing, as I have been using java for some time, but I recently came across a classpath conceptual difficulty.
    My understanding was that 'javac' uses classpath to find the path to any classes referenced in a target for compilation. However, I couldn't come up with any concrete rationale for using an additional classpath for 'java', the JVM command, when developing your own applications (I can see its importance for third party classes).
    Doesn't javac encode the classpath passed to it in the compiled class file itself? (I figured this because even if I do not specify a classpath to the 'java', the program still executes fine). If this is true, then the only way I see the 'java' classpath being useful is if you were to change around the location of the class files after compilation.
    Any thoughts would be greatly appreciated.

    Btw, there is no distiction between java and javac
    classpaths. They're both the classpath.only difference i see there could be, is that, for
    javac you tell the path to your .java file that
    need's to be compiled, and for java you tell the name
    of class whose main() method it should run (or you
    tell which .jar file to execute)That's not relevant here. Classpath is used the same way for both of them. Classpath has nothing to do with finding a .java file to compile.
    The only difference, I think, is that I think by default, the directory holding the package root of any .java file given as an arg to javac is implicitly added to the classpath. I'm not sure about that though.
    >
    so in some cases you would need to include "." in
    your classpath for execution, but would not need to
    include it for compilation.
    just my 2 cents

  • Sar ignored in javac classpath

    We are in the process of moving from Java 1.4 (1.4.2_02 on Linux) to Java 5 (1.5.0_12) and since we deploy to a JBoss environment we generate .sar files. In some cases those .sar files are used in the classpath when compiling other packages. Using the javac in Sun JDK on Linux version 1.5.0_12 the .sar files in the classpath are ignored. If I do a javac -verbose I can see that the .sar files are left out of the classpath even though they ar epresent on the command line. Does anyone know if this is a bug in the JDK or is intended behavior?

    Hi,
    are there any clues on this issue?
    I have the same problem while moving from 1.5.0_06 to 1.5.0_14.
    You can even reference very uncommon extentions (i.e. rename a *.jar to *.bug) in the 06 version. The newer version quietly ignores this reference and leaves you with a "cannot find symbol".

  • UIManager ClassPath ignored? (access violation)

    Appologies if this is a second post, but I do not believe my previous post worked. I do not see it in the list of topics...
    I've encountered a serious problem: I can not use any 3rd party look and feel
    implementations inside the Java Web Start secure sandbox. More specifically,
    they work unless you use the FileOpenService or FileSaveService, which bring
    up a JChooser with UI components that are in the wrong ClassLoader and cause
    access violation exceptions.
    Some code I have tried to (unsuccessfully) work around this problem:
    // Attempt #1
    ClassLoader jwsClassLoader = this.getClass().getClassLoader();
    UIManager.put("ClassLoader", jwsClassLoader);
    SlafLookAndFeel slaf = new SlafLookAndFeel("com.memoire.slaf.SlafLookAndFeel"); UIManager.setLookAndFeel(slaf);
    This brings up the SLAF look and feel for everything but the FileOpenService.
    Exception pasted below.
    // Attempt #2
    // After executing the above code, I also run this:
    Hashtable tb = UIManager.getDefaults();
    tb.put("ClassLoader", jwsClassLoader);
    Enumeration e = tb.keys();
    while (e.hasMoreElements()) {
    Object obj = e.nextElement();
    if (! (obj instanceof String))
    continue;
    String k = (String)obj;
    if (k.endsWith("UI")) {
    Class uic;
    try {
    uic = jwsClassLoader.loadClass(tb.get(k).toString());
    } catch(Exception ex) {
    // classnotfound...
    continue;
    tb.put(uic.getName(), uic);
    Again, this does not help.
    // Attempt #3
    In Sun bug:4155617 the username 'awiner' posted a message that contained
    some code to register your own ClassInstantiator (implements UIDefaults.LazyValue)
    I would like to try this, but I do not know how to use the code presented.
    I think it needs to be integrated within the Look and Feel code?
    Here's the exception:
    java.security.AccessControlException: access denied (java.io.FilePermission /tmp read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401) at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
    at java.io.File.exists(File.java:677)
    at javax.swing.filechooser.FileSystemView.getSystemDisplayName(FileSystemView.java:140)
    at javax.swing.plaf.basic.BasicFileChooserUI$BasicFileView.getName(BasicFileChooserUI.java:1005)
    at javax.swing.JFileChooser.getName(JFileChooser.java:1437)
    at com.memoire.slaf.SlafFileChooserUI$DirectoryComboBoxRenderer.getListCellRendererComponent(SlafFileChooserUI.java:605)
    at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1147) at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1097)
    at javax.swing.plaf.basic.BasicListUI$ListSelectionHandler.valueChanged(BasicListUI.java:1465)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:187)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:214)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:402)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:411)
    at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:435)
    at javax.swing.JList.setSelectedIndex(JList.java:1730)
    at javax.swing.plaf.basic.BasicComboPopup.setListSelection(BasicComboPopup.java:998)
    at javax.swing.plaf.basic.BasicComboPopup.access$000(BasicComboPopup.java:43)
    at javax.swing.plaf.basic.BasicComboPopup$ItemHandler.itemStateChanged(BasicComboPopup.java:782)
    at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1161)
    at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1218)
    at javax.swing.JComboBox.contentsChanged(JComboBox.java:1265)
    at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:100)
    at com.memoire.slaf.SlafFileChooserUI$DirectoryComboBoxModel.setSelectedItem(SlafFileChooserUI.java:751)
    at com.memoire.slaf.SlafFileChooserUI$DirectoryComboBoxModel.addItem(SlafFileChooserUI.java:746)
    at com.memoire.slaf.SlafFileChooserUI$DirectoryComboBoxModel.access$500(SlafFileChooserUI.java:665)
    at com.memoire.slaf.SlafFileChooserUI$1.propertyChange(SlafFileChooserUI.java:500)
    at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:264)
    at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:232)
    at javax.swing.JComponent.firePropertyChange(JComponent.java:3814)
    at javax.swing.JFileChooser.setCurrentDirectory(JFileChooser.java:541)
    at javax.swing.JFileChooser.<init>(JFileChooser.java:333)
    at com.sun.jnlp.FileOpenServiceImpl$1.run(FileOpenServiceImpl.java:82)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.jnlp.FileOpenServiceImpl.openFileDialog(FileOpenServiceImpl.java:73) at com.wss.calendar.client.swing.InfoHTML.jButtonUpload_actionPerformed(InfoHTML.java:217)
    at com.wss.calendar.client.swing.InfoHTML$3.actionPerformed(InfoHTML.java:146) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5093)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
    at java.awt.Dialog.show(Dialog.java:538)
    at java.awt.Component.show(Component.java:1134)
    at java.awt.Component.setVisible(Component.java:1089)
    at com.wss.calendar.client.swing.ScheduleWorldFrame.showInfoView(ScheduleWorldFrame.java:2247)
    at com.wss.calendar.client.swing.ScheduleWorldFrame.jMenuItem14_actionPerformed(ScheduleWorldFrame.java:2226)
    at com.wss.calendar.client.swing.ScheduleWorldFrame$44.actionPerformed(ScheduleWorldFrame.java:1127)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1109) at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
    at java.awt.Component.processMouseEvent(Component.java:5093)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

    Hi,
    I am using jdk1.1.6 and personal oracle 8.0.3.0.0.
    I set my classpath to [home]\jdbc\lib\classes111.zip.
    (I am not sure how to try with thin driver to make sure
    everything else is ok).
    I hope you guys got the information to suggest me some solution
    to the problem below. I would greately appeciate if any help to
    solve the problem..
    Thank you,
    Sreenivas.
    Oracle Product Development Team wrote:
    : Need more information :
    : What JDK are you using ?
    : What is the Server version ?
    : Try with THIN to make sure that everything else is okay
    : Sreenivas Kompelli (guest) wrote:
    : : I have Oracle 8i trial version installed on my NT work
    : station.
    : : After configuring the CLASSPATH and PATH, When I try to run a
    : : sample example from files given (I am just trying to connect
    to
    : : the database using JDBC oracle/oci, and display the EMP
    table).
    : : I am getting a Windows internal Error "Exception: Access
    : : Violation (0xc0000005).
    : : I have no clue what to do.. I would greately appeciate if any
    : : help to solve this problem..
    : : Thanks
    : : Sreenivas
    : Oracle Technology Network
    : http://technet.oracle.com
    null

  • Classpath ignored on windows?

    Using the javazoom mp3 player in an applet doesn't work, the file jl0.4.jar needs to be in the CLASSPATH
    so I added it. Here is the output from cmd (on win2k)
    C:\>set CLASSPATH
    CLASSPATH=C:\projects\java\mp3Player\jl0.4.jar
    C:\>
    When I run my mp3Player as an applet I get the following error.
    Java.lang.NoClassDefFoundError: javazoom/jl/player/advanced/PlaybackListener
         at clsPlay.play(clsPlay.java:142)
         at clsPlay.run(clsPlay.java:45)
         at java.lang.Thread.run(Unknown Source)
    I could add the code for my player if so needed but if anyone knows what could be the problem please let
    me know.

    Setting the classpath in:
    right clicking my computer -> properties -> advanced -> environment variables -> System variables -> new -> CLASSPATH -> .;C:\projects\java\mp3Player\jl0.4.jar -> OK -> reboot
    Doesn't help
    Created the file:
    C:\whatsMyClasspath.bat
    with content:
    ECHO "My cp is:" > OUT.TXT
    SET CLASSPAHT >> C:\OUT.TXT
    Doubleclicked it in Explorer and the content of c:\out.txt is:
    "My cp is:"
    CLASSPAHT=.;C:\projects\java\mp3Player\jl0.4.jar
    Opened IE6 and browse to C:\whatsMyClasspath.bat
    CLASSPATH=.;C:\projects\java\mp3Player\jl0.4.jar
    Closed all ie's and opened the fiel with the applet, error:
    java.lang.NoClassDefFoundError: javazoom/jl/player/advanced/PlaybackListener
    Same browser I opened C:\whatsMyClasspath.bat again out.txt is now:
    My cp is:
    CLASSPATH=.;C:\projects\java\mp3Player\jl0.4.jar
    Set the classpath in:
    right clicking my computer -> properties -> advanced -> environment variables -> User variables -> new -> CLASSPATH -> .;C:\projects\java\mp3Player\jl0.4.jar -> OK ->
    set it in autoexec.bat
    -> reboot
    No luck still
    I am confinced that classpath doesn't work on win 2000 machines with applets.
    Opened the java control panel -> advanced -> java runtime parameters -> filled in the following:
    -classpath .;C:\projects\java\mp3Player\jl0.4.jar;
    Now it works, seems to me that setting environment variables works when you start java apps @ the
    command prompt but is useless when using applets.

  • Javac -classpath . ./baza/program.java

    Error: Super class "<gen>" is not accessible: it is not in the same package
    and not public. Please help, what should I do?

    Error: Super class "<gen>" is not accessible: it is
    not in the same package
    and not public. Please help, what should I do?Why is the error message not clear?
    You have code that looks like the following...
       package com.x.y;
       class gen
       package com.zzzzz.aaaaaa;
       class child extends com.x.y.gen
    In the above 'gen' is not 'public' so it can't be accessed in package 'com.zzzzz.aaaaaa'

  • Classpath for java and javac

    Hi,
    I'm a bit confused as to when include the "current" path to java/javac's "-classpath". For instance, if the project has the following structure:
    test
      |___foo (package "foo")
             |___B.java (extends foo.A)
             |___A.javaand the "current" directory is at "test/", then a simple "javac foo/B.java" or "java foo.B" works. However, if the structure of the project is altered to the following:
    test
      |___foo  (package "foo")
      |      |___B.java (extends foo.A and imports boo.C)
      |      |___A.java
      |
      |___myapp (just a directory)
              |____boo (package "boo")
                    |____C.javathen in order to compile or run foo.B when the current directory is at "test/", I have to explicitly specify the "current" directory (or "."), i.e.
    javac -classpath myapp/:. foo/B.java or java -cp myapp/:. foo.B
    Why is it that in the first example, the current directory need not to be specified (".") but in the second example, it must? Is it because as soon as "-classpath/-cp" option is included in the command line, java ignores the default current path ("./")?
    Sincerely,

    If nothing is specified via -cp and no CLASSPATH is set, then the default classpath contains one entry, which is the current directory (a.k.a the classpath is ".").
    If you set the classpath, then the classpath is exactly what you set it to and doesn't include any default.
    That's the only reasonable way to model such things, because if you included the current directory in all cases, then that would produce many unexpected side effects.

  • Javac.exe  is not using classpath, while java.exe is.

    I'll state the problem, then give my configuration. This does NOT seem to be a duplicate of other problems. I am running Windows NT sp 6a.
    INTRO:
    javac.exe, java.exe in directory E:\v\bin.
    file HelloWorld.java is in directory E:\v\lib\x\y (dir names shortened)
    PROBLEM:
    Once HelloWorld is compiled (and HelloWorld.class is in E:\v\lib\x\y ), I can run the exact command "java HelloWorld" from ANY directory anywhere and it runs and prints Hello World!.(So java.exe seems to be using classpath.)
    However, to compile, the command "javac HelloWorld.java" does not work (say in E:\v). The error message is "cannot read: "HelloWorld.java". I have to provide the full path name for HelloWorld.java, thus: "javac E:\v\lib\x\y\HelloWorld.java". This works, from any directory anywhere. In other words, javac.exe does NOT seem to be using classpath.
    CONFIGURATION:
    CLASSPATH is set to E:\v\lib\x\y in both system and user environment and ALSO through both javac -classpath and java -classpath. (When I run javac -classpath E:\v\lib\x\y, the list of options is not printed out, and I think this means the classpath is supposed to be set. ) I also tried setting sourcepath for javac, but that did not help.
    PATH is set since and the system recognizes the commands "java" and "javac" from any directory anywhere (each brings up the list of options.)
    Any thoughts.

    let's read the documentation first shall we ...
    http://java.sun.com/j2se/1.4.1/docs/tooldocs/windows/javac.html
    According to it the command line arguments must be file names. The compiler "cannot read HelloWorld.java" because it simply is not in the current working directory. You need to specify a path to the file. It is only after that, "when compiling a source file", that the classpath or sourcepath setting has any effect.

  • When running an .sh file the terminal is "ignoring" the *

    For some reason if i type ./mac-compile.sh
    i get
    kevin-roses-computer:~/Desktop/nexus kevinrose$ ./mac-compile.shCompiling Randomsjavac: invalid flag: Randoms/*.javaUsage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are used
    -classpath <path> Specify where to find user class files
    -cp <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -version Version information
    -help Print a synopsis of standard options
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system
    Compiling Scripts
    javac: invalid flag: Scripts/*.java
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are used
    -classpath <path> Specify where to find user class files
    -cp <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -version Version information
    -help Print a synopsis of standard options
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system
    kevin-roses-computer:~/Desktop/nexus kevinrose$
    but if i execute the command
    the first one in the file
    kevin-roses-computer:~/Desktop/nexus kevinrose$ javac -classpath .:././jars/impsoft.jar:././jars/swt.jar:././jars/jython.jar:././plugins Randoms/*.java
    kevin-roses-computer:~/Desktop/nexus kevinrose$
    and it has worked. Any clue why its ignoring the *
    here is the contents of the .sh file.
    echo Compiling Randoms
    javac -classpath .:././jars/impsoft.jar:././jars/swt.jar:././jars/jython.jar:././plugins Randoms/*.java
    echo Compiling Scripts
    javac -classpath .:././jars/impsoft.jar:././jars/swt.jar:././jars/jython.jar:././plugins Scripts/*.java

    You posted this question last week and I recall posting a plausible answer which I'll expand on here.
    Javac shows this behaviour when the shell script file doesn't have the correct end of line characters. This can happen when the file is generated on one platform and transferred across to Mac OS X. Since the script file is fairly short, it would be easy to retype it into TextEdit and then save a new version.
    Be sure to change the file permissions by using chmod in Terminal:
    chmod 777 filename
    Bob

  • Can't import schemas in classpath when generating JAXB

    I'm trying to create schemas that are used to provide basic components for more complex schemas, using the same design idea behind creating abstract Java classes and then extending them. I'm having trouble referring to classes in different modules, though. Below is the start of a schema that refers to a schema that is stored in another jar file:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://xml.kitfox.com/schema/tw/ts"
        elementFormDefault="qualified"
        xmlns:tns="http://xml.kitfox.com/schema/tw/ts"
        xmlns:cmn="http://xml.kitfox.com/schema/common">
        <xsd:import schemaLocation="/com/kitfox/common.xsd" namespace="http://xml.kitfox.com/schema/common"/>
        <xsd:complexType name="sourceType">
            <xsd:attribute name="uid" type="cmn:uidType"/>
        </xsd:complexType>I'm generating my JAXB with the following task:
        <target name="bind-preferences" depends="init">
            <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
                <classpath>
                    <pathelement path="${javac.classpath}"/>
                </classpath>
            </taskdef>
            <xjc destdir="gen" extension="true" removeOldOutput="true">
                <schema dir="src">
                    <include name="**/*.xsd"/>
                </schema>
                <produces dir="gen">
                    <include name="**/*.java"/>
                </produces>
            </xjc>
        </target>Unfortunately, this causes the following error:
    [WARNING] schema_reference.4: Failed to read schema document '/com/kitfox/common.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
      line 9 of file:/C:/dev/kitfox.com/gameEngine/proj/tileWorld/src/com/kitfox/tw/ts.xsd
    [ERROR] src-resolve: Cannot resolve the name 'cmn:uidType' to a(n) 'type definition' component.
      line 24 of file:/C:/dev/kitfox.com/gameEngine/proj/tileWorld/src/com/kitfox/tw/ts.xsd
    [ERROR] src-resolve: Cannot resolve the name 'cmn:uidType' to a(n) 'simpleType definition' component.
      line 24 of file:/C:/dev/kitfox.com/gameEngine/proj/tileWorld/src/com/kitfox/tw/ts.xsdI know that the classpath passed into the xjc task contains the jar with my original schema. What can I do so that JAXB finds it? Also, how would I tell JAXB to extend the classes already generated for common.xsd in my original jar rather than regenerating them in the jar I'm compiling?

    Thanks. I've looked into using a catalog (the ant task allows you to specify a catalog), but don't think I've got the syntax right. Does the following look right to you?
    <!DOCTYPE catalog
      PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
             "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
    <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
             prefer="public">
      <uri name="common.xsd"
       uri="../gb/src/com/kitfox/common.xsd"/>
    </catalog>I've changed my schema to look like:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://xml.kitfox.com/schema/tw/ts"
        elementFormDefault="qualified"
        xmlns:tns="http://xml.kitfox.com/schema/tw/ts"
        xmlns:cmn="http://xml.kitfox.com/schema/common">
        <xsd:import schemaLocation="common.xsd" namespace="http://xml.kitfox.com/schema/common"/>
        <xsd:complexType name="sourceType">
            <xsd:attribute name="uid" type="cmn:uidType"/>
        </xsd:complexType>I'm still getting errors:
    [WARNING] schema_reference.4: Failed to read schema document 'common.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
      line 9 of file:/C:/dev/kitfox.com/proj/tw/src/com/kitfox/tw/ts.xsd
    [ERROR] src-resolve: Cannot resolve the name 'cmn:uidType' to a(n) 'type definition' component.
      line 24 of file:/C:/dev/kitfox.com/proj/tw/src/com/kitfox/tw/ts.xsd
    [ERROR] src-resolve: Cannot resolve the name 'cmn:uidType' to a(n) 'simpleType definition' component.
      line 24 of file:/C:/dev/kitfox.com/proj/tw/src/com/kitfox/tw/ts.xsdI've tried some variations such as leaving out the import/@schemaLocation attribute and hoping that the catalog could resolve that with the namespace alone or creating a fake http:// url for the schemaLocation, but none of that works. Would you know what I'm doing wrong with this catalog? The catalog and ant file are in the same directory and the relative path to the common.xsd file is correct.

  • How to include .jar file in our classpath

    I want to do serial communication.I have one demo program but in it they mention that set comm.jar file in your class path.Then how can I set comm.jar file in my class path?

    Javapedia: Classpath
    How Classes are Found
    Setting the class path (Windows)
    Setting the class path (Solaris/Linux)
    Understanding the Java ClassLoader
    java -cp .;<any other directories or jars> YourClassName
    javac -classpath .;<any additional jar files or directories> YourClassName.java

  • I tried to set the classpath, here is what I did, any help would be appreci

    javac -classpath/WINDOWS/Desktop/school/Java Projects/assignment2sem2/exercise9.10

    howdy.
    ok. this is a constant problem with newbies. i'm not picking on you but if you don't know how to figure out class paths then you have a fundamental lack of understanding of java. understanding class paths are at the core of the java language and using an IDE that supposedly controls this for you is not helping your situation. my suggestion to you is to use a text editor and the command prompt to create and run your java programs. you won't believe how much more you understand after fooling around with java this way for a few months.
    good luck.

  • I can't set my classpath to compile serlets any help?

    I don't understand I'm doing it the way my book says to do it but I can't for the life of me set a freaking class path for my tomcat server so I can compile my serlets here's how it says to do it
    C:\Documents and Settings\Compaq_Owner\Desktop>javac -classpath C:\Program Files\Apache Software Foundation\Tomca
    t 5.0\common\lib\servlet-api.jar
    Can anyone tell me what the hell I'm doing wrong any help is greatly appreciated thanks

    Ok I think I get what your saying but couls someone show me the syntax where to include the source files at and how here's what I did but it couldn't read the file so I'm guessing I'm not putting it in right and also is there a way to permanently set the classpath so I won't have to go through this everytime I want to compile java servlet files?
    C:\Documents and Settings\Compaq_Owner\Desktop>javac -classpath "C:\Program Files\Apache Software Foundation\Tomc
    at 5.0\common\lib\servlet-api.jar" "C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\jhtp6\WEB-INF\
    classes\WlcomeServlet.java"
    error: cannot read: C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\jhtp6\WEB-INF\classes\WlcomeSe
    rvlet.java
    1 error

Maybe you are looking for

  • Printing both sides on HP 2550 L Colour Laserjet

    I've just moved over to Vista Home premium from XP pro and tries to print two sided document but no mention of that in the Properties screens. Am I mad?  It was there in XP.  Have I done something wrong? The printer seems to be using PS docusk

  • Problem with Bulk Collect ... FORALL

    I've written following code to bulk collect records from a cursor into a collection and insert it into a table using FORALL loop OPEN x;     LOOP       FETCH x BULK COLLECT INTO v_collection LIMIT 1000;       FORALL i IN 1..v_collection.count        

  • JDBC MS SQL Server driver catch SQLException on Update statement

    Hi, We change the driver for the BEA WebLogic Type 4 JDBC MS SQL Server driver driver=weblogic.jdbc.sqlserver.SQLServerDriver url=jdbc:bea:sqlserver://db_name:port_number since we use this driver we got an error when the application try to update a f

  • FB75 - Error

    Hi, While testing the upgrade from 4.6B to 4.7, we are getting error as below. Go to Tcode FB75 Click - Tree on Click any variant on left side panel. We get error as: <b>The entry 001   is missing in table TAB_FSKB</b> when click the ok button on the

  • I got an error message when I tried to install OS X

    I tried to install OS X 3 times and got an error message. What should I do?