Compiling java files in DOS window

Hi,
I have been writin a small Client Server Application. I am attempting to use java packages in order to put certain class files into particular directories, and then import the packages when needed.
So far, i have started my 1st attempt at a very small application just to send / receive messages. My problem is however, that i can compile all the java files into specific directories & packages no problem, but when i try to compile the java files which make use of these classes, i keep getting the same error.
OK, i will try to simplify,
My Server program (called MyServer.java) uses 2 classes (called ProcessTransaction, and NumberValidator), I have compiled the generated class files from ProcessTransaction.java and NumberValidator.java files into a DIR called C:\JavaForm\serverstuff. i.e. my server program imports the package "serverstuff,*;" The problem is that when i try to compile my server program i get the error message:
"cannot access ProcessTransaction
bad class file: c:\JavaForm\ProcessTransaction.java
file does not contain class ProcessTransaction
Please remove or make sure it appears in the correct subdirectory of classpath"
I am using the command:
javac -classpath c:\JavaForm c:\JavaForm\MyServer.java to compile the server file
All the java and class files are stored in the C:\JavaForm folder
I dont understand why the ProcessTransaction call cannot be accessed because it is most definitely in the compiled java file!!!
Any help would be much appreciated!!!
Cheers
Iain

it's OK, i figured out that to compile the Server program successfully, you have to remove all the other java files from the DIR which the Server.java files exists, or else there is a conflict!!!! I dont know why, but that's what you have to do!!!!

Similar Messages

  • Cannot compile Java files or create Java Project

    Hi,
    I cannot compile java files and also didn't see any option
    for creating java project using flex 2 builder.
    Actually am trying to create a FDS project with an option to
    compile on the server. I am using Weblogic 8.1 SP5 as my server.
    thank you
    sun

    hi
    this is may jvm.config file. Can anyone tell me if it is
    right because all the fields are blank.
    # VM configuration
    # Where to find JVM, if {java.home}/jre exists then that JVM
    is used
    # if not then it must be the path to the JRE itself
    # If no java.home is specified a VM is located by looking in
    these places in this
    # order:
    # 1) JAVA_HOME environment variables (same rules as java.home
    above)
    # 2) bin directory for java.dll (windows) or
    lib/<ARCH>/libjava.so (unix)
    # 3) ../jre
    # 4) registry (windows only)
    java.home=C:\Adobe\Flex Builder 2.0 Beta 3\Flex SDK 2.0\jre
    # Arguments to VM
    java.args=-ea -Xmx384m
    # Environment variables we care about, whitespace-separated
    env=
    # java.class.path - use this for adding individual jars or
    # directories. When directories are included they will be
    searched
    # for jars and zips and they will be added to the classpath
    (in
    # addition to the directory itself), the jar to be used in
    launching
    # will be appended to this classpath
    java.class.path=C:\Adobe\Flex Builder 2.0 Beta 3\Flex SDK
    2.0\jre
    # where to find shared libraries, again use commas to
    separate entries
    java.library.path=
    thanks
    sun

  • Cannot compile java file after ..

    i installed java sdk 1.4
    uninstalled java 1.2 & java 1.3.1
    --after that i was not able to compile or run java file
    reinstalled java 1.3.1 and 1.2
    --now able to run previously compiled java file
    --cannot compile a new java file
    any help

    It would be helpful if you would exactly tell us what error message you get instead of just saying "I can't compile or run anything anymore".
    Things to think of: Did you add the bin directory of the JDK to your path? Is the classpath set correctly?
    Installation notes
    http://java.sun.com/j2se/1.4/install-windows.html
    Setting the class path
    http://java.sun.com/j2se/1.4/docs/tooldocs/win32/classpath.html
    Java 2 SDK Readme
    http://java.sun.com/j2se/1.4/README.html
    Jesper

  • Error while compiling java file

    Hi, im newby in java,
    i was trying to compile java files, and after that i will use it in JSP as javabean.
    I have 2 files already, the first file is a connection code, and its compiled successfully, it looks like this
    i named this as ConnectionBean.java
    package my_package;
    import java.sql.*;
    public class ConnectionBean {
         private Connection con;
         private static final String driver = "org.postgresql.Driver";
         private static final String url = "jdbc:postgresql://localhost:5432/PSQLDS";
         private static final String username = "postgres";
         private static final String password = "mypassword";
         public ConnectionBean() {
         public Connection logOn() {
              try {
                   Class.forName(driver); con = DriverManager.getConnection(url, username, password); }
              catch(ClassNotFoundException e) {
                   System.err.println("ConnectionBean: driver unavailable..."); con = null; }
              catch (SQLException e) {
                   System.err.println("ConnectionBean: driver not loaded..."); con = null; }
              return con;
         public void logOff() {
              try {
                   con.close(); }
              catch (Exception e) {
                   e.printStackTrace(); }
    as you can see above im using "package", and yes i have manage to put all my java files within the correct path (ROOT\WEB-INF\classes\my_package)
    And also, i have test this class as javabean on JSP file and it works.
    There for i continue to create the second java file, as a purpose to create a back engine for JSP. I use the same package as ConnectionBean.java, it looks like this
    i named this as ListPageEngine.java
    package my_package;
    import java.beans.*;
    import java.sql.*;
    public class ListPageEngine {
         public static void main(String[] args) {
              ConnectionBean conBean = new ConnectionBean();}
    on compiling process using command "javac ListPageEngine.java", i get this error message
    ListPageEngine.java:11: cannot find symbol
    symbol : class ConnectionBean
    location: class my_package.ListPageEngine
    ConnectionBean conBean = new ConnectionBean();}
    ^
    ListPageEngine.java:11: cannot find symbol
    symbol : class ConnectionBean
    location: class my_package.ListPageEngine
    ConnectionBean conBean = new ConnectionBean();}
    ^
    2 errors
    I think, i am pretty much sure that all my configuration (wheater its Apache TomCat, Environment Variable or PostgreSQL server) was good, as a prove, i was able to use ConnectionBean.class in my JSP file.
    I susspect the problem is related with "package", seems i cannot use ConnectionBean class within ListPageEngine class when i use package.
    For another information, i didn't install such thing as J2EE, i only install JDK 1.5, i also guess this might be the cause.
    Right now im all stuck, i try to find thread which might be related with my problem but i failed to find it, most of them get the same answer by UncleSAM which are
    Try the following forum (about JSP technology)
    http://forum.java.sun.com/forum.jspa?forumID=45
    JavaBeans spec contains nothing about JSP, but JSP spec describes using of beans.
    i hope my question is clear so anyone who might have experience or clue with this problem might be able to help me.
    Thanks before

    finally folks, i found answer to my own problem hehehehe..
    the problem is on the compiling command (javac ... my_file.java), i found that i need to add some parameter on the command to make it works.
    This problem solved.

  • Problem compiling java file to access web service! newbie troubles !

    I am new to web services and this is my first program...
    I am compiling java file which has import statement like:
    import org.apache.soap.util.xml.*;
    import org.apache.soap.*;
    import org.apache.soap.rpc.*;
    It says ----- package org.apache.soap.util.xml does not exist as one of errors..
    I have a folder that I named soap myself and I have activation.jar,serces.jar,mail.jar,soap.jar in it.
    I added c:\soap in my classpath and this was supposed to be the quickstart way to try an example out...
    but it gives me compilation errors... what should I do ?

    You'll need to specify each jar file in the classpath. c:\soap\xerces.jar;c:\soap\sax.jar;....

  • How to check the JDK version of a compiled java file

    can anybody tell me how to check the JDK version of a compiled java file ?
    Edited by: gbhatia8 on Sep 9, 2010 7:04 AM

    The major/minor version of the class file is the way to go.
    Also, it's not necessary to write a separate program to get to those. javap prints them out when being passed the -v flag.
    Note, however that "JDK version" is not a correct term, as I can create 1.4-compatible class files with a Java 6 JDK (by passing the -target flag to javac). Those won't look any different than .class files written with a 1.4 JDK.

  • Location of compiled java files

    Where are the compiled java files for jsps? Sometimes I get jsp errors in the log
    files like:
    D:\jsrv\my\WEB-INF\_tmp_war_myserver_myserver_my\jsp_servlet\_mypage\_cancelmembership.java:105:
    ')' expected
    However, the _cancelmembership.java file does not exist at that location. Only
    the _cancelmembership.class file exists at that location.

    You do NOT want to change the bundled CSS files. Create your own CSS and include it in the template after the built-in CSS include. Any classes you create in your own file of the same name and specificity as the built-in classes will override those classes. For example:<style type="text/css">
    td.myclass{color:red}
    td.myclass{color:blue}
    </style>The color of the text in a table cell with the class "myclass" will be blue, not red, since the same class was defined twice, it will use the one that came last on the page.
    If you change the classes in the built-in template CSS files, you'll change them for everyone using your APEX instance, which is not a particularly good thing to do.
    Tyler

  • Compiling java file in 11i

    I need to compile java file in CRM 11i .

    1003984 wrote:
    I need to compile java file in CRM 11i .Please see (HOW TO COMPILE JAVA FILES IN CRM APPLICATIONS [ID 468434.1]).
    Thanks,
    Hussein

  • Running a compiled java file

    Question: if a pc doesn't have the jre, how can it launch a compiled java file? For example, i create a program that calculates the expenses of a factory, i create the gui and i compile the file. Then i distribute my program. If a factory doesn't have jre, i suppose it can't launch the program...how can i do? can i create an exe file from java one?

    If the machine has a browser, it probably has a jre, but that is beside the point. No it cannot run without a jre. If there is not one, it must be installed.

  • Creating a .bat file to compile .java files

    Hi,
    I am trying to create a .bat file to compile java files. I have created the .bat in the same folder as teh .java file I am trying to compile. I know the path is set to the proper folder to find the compiler, but I keep getting an error saying the system can not find the specified file, or can not read fileName.java. Everything is spelled correctly, and I know it works because it will compile from the command prompt. Any suggestions?

    rather than including a sourcepath, just specify the full location. Using your example, this would read like
    javac "C:\Documents and Settings\Kevin\Desktop\School Stuff\AP Comp Sci\PowerPoints\Chapter 02\Executables\Section 2.2\Facts.java"Note that everything is inside the inverted commas " "
    I tried this on a hello world Java program inside a brief case and it works fine.
    The class file is created inside the briefcase.
    If you want to create a bat file to do this from anywhere, modify your batch file to look like this:
    c:\
    cd "C:\Documents and Settings\Kevin\Desktop\School Stuff\AP Comp Sci\PowerPoints\Chapter 02\Executables\Section 2.2"
    javac %1.java
    java %1Again, you would use this as follows
    mybat FactsDon't forget to leave out the .java extension.
    This will compile the java file and attempt to run it for you.
    If you don't want it to run, leave out the java%1
    If you create other java files in this same briefcase folder you can use mybat to compile them too.
    For example
    mybat Facts2

  • Convert  strange  characters  to  compilance java file

    Hi guys
    I need help!
    How I can translate these strange characters
    into an compilance java file
    are these a memory locations ,machine language , or
    in which language they are written?
    thanks in advance.
    �� - y ��� � ()I ()J ()Ljava/lang/String; ()V ()Z (I)Ljava/lang/String; (IC)Ljava/lang/StringBuffer; (II)Ljava/lang/String; (J)V (Ljava/lang/Object;)Z &(Ljava/lang/String;)Ljava/lang/String; ,(Ljava/lang/String;)Ljava/lang/StringBuffer; (Ljava/lang/String;)V '(Ljava/lang/String;I)Ljava/lang/String; '(Ljava/lang/String;Ljava/lang/String;)V - 0000 <init> Code DC- Illegal key J
    SourceFile [DashoPro-V1.3BETA-091199] a append b c com/diginet/digichat/common/a3 com/esial/util/c d e equals f g h insert java/io/Serializable java/lang/Exception java/lang/IllegalStateException java/lang/Long java/lang/Object java/lang/String java/lang/StringBuffer java/util/Random length      longValue      substring toString 5 4 3 1 % / & 0 2 . 6      - 9 ! " $ ' ! # ,
    +
    '      (      $      ! ! ) 8 8 7
    : D
    ; E
    < F
    ; G
    ; H
    = I
    = H
    > J
    ; D
    ; K     > L     > M     > N     > O �
    > P
    > Q
    > R
    > S
    > T
    @ U
    A E
    > V
    < W
    < X
    < Y
    B D
    = E
    = Z 1 > B C ! # $ ' ! ? 3� :Y� [N� ;Y+� \:+� ]6� 0� ^W����� _� ! b V*� e     �� *� f     �� �� =Y*� f� `� aL� =Y*� e� `� aM*+� bL*,� bM� ;Y� c+� d,� d� _� # b V*� g     �� *� h     �� �� =Y*� h� `� aL� =Y*� g� `� aM*+� bL*,� bM� ;Y� c+� d,� d� _� $      * *� g i�<*� f i�= �� '      A 5*� h i�<*� f i�=*� f{ i�>�~6 �� (      D 8*� h i�<*� g{ i�=�~>*� e
    { i�6 �� *
    B .*� kW*� lW*� m� *� n� *� o � �L� + + ? +
    C 7*� g
    ��@*� f
    ��B!�� !     �� � �� AY� p� q� ,
    > 2*� g{
    �<*� e{
    �=
    � � �� AY� p� q� 1 9 � �*� rL+� s� �++� ]d� tM++� ]d� uN-� ]� !� ;Y� c-� ]d� t� d-� d� _N,� ]� !� ;Y� c,� ]d� t� d,� d� _M� ;Y� c� d-� d� d,� d� _� *� v� � �*� v� ;Y� c+� u� d+� t� d� _N,� ]6-� ]6*� =Y,d� u� w� x� g*� =Y,dd� t� w� x� h*� =Y-d� u� w� x� e*� =Y-dd� t� w� x� f�{code}{code}
    Edited by: vanpersie on Feb 9, 2008 12:35 PM

    This data is Bytecode of a Java class. Read about Java Bytecode structure in Java Documentation at SUN Site.

  • How does javac compile .java files?

    I dont know exactly what classpath javac uses to compile java files. i have set classpath to only tools.jar . and it compiles fine. i thought all standard java class files are present in tools.jar. But... when i opened tools.jar i didnt find most of the class files i expected to see there. In fact there was no java.lang, java.io ... so on packages in it. then how is that compiler compiled ? Of course i found rt.jar under jre/lib, which contained all the mentioned packages...but then i didnt give it in the classpath.
    Any body pls clear my doubts.

    Check out the doc "how classes are found" in the tool
    docs, it will explain how classes are found in
    detail.
    tool docs:
    http://java.sun.com/j2se/1.3/docs/tooldocs/tools.html
    I read the docs and understood that javac.exe loads dt.jar before it could compile .java files. but then what is the use of giving tools.jar in classpath.. i ve seen javac giving problems without it.

  • How to compile .java files in windows server

    Hi All,
    I want to compile my CO.java file in server directly how can i do that my server is windows server
    If it is Linux i can login through putty and go to java top and then file location then i use to do javac filename.java then i use to get filename.class but now same thing i did in windows server which is not working please sugget how to do its bit urgent.

    Why do you want to compile it on the server and not in jdeveloper? You should be able to issue the javac command from the prompt. Your unix account must have permissions to that command though.
    For more info on the javac command:
    http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/javac.html
    Kristofer Cruz

  • How can I read ALL the compilation errors in a DOS window?

    On compilation using a DOS window, if the number of errors exceeds the window size, some of the errors disappear off the top of the window and I cannot read them.
    Is there an effective solution to somehow use scrolling of the DOS window or transfer the compilation errors to a file?

    Hey buddy,
    When I first started programming with Java, I wondered the same thing. I have the very best solution for you. This one is waaay easy!!!!
    There is a text editor which will not only color code your text for you, but you can easily configure it to give you the compiler /DOS output for Java. Just go to this website and download the program. Enjoy!
    http://www.textpad.com/

  • Compile source file problem using Windows ME

    After editing the variable value PATH to,
    c:windows;c:\windows\command;c:\jdk1.3.1\bin and saving file HelloWorldApp.java(from First Cup of Java;Sun tutorial)to c:\java .I proceed with the tutorial but haven't got a clue what command to put after c:\windows> (in the MS-DOS Prompt window I am now at)..in order to view HelloWorldApp.java so that I can compile.(I've tried putting cd as per tutorial but get 'bad command or file name' appearing on the screen).
    Detailed help very much appreciated!!

    If I may ask:
    How new to java are you?
    I remember the feeling well.
    If you have installed the java SDK and set your path, then restarted your machine so that the startup process recognizes your new path.
    ... probably done, since time has gone by...
    Then saved your : something.java file to a directory.
    You start a dos session and navigate to your :
    C:\documents\javaStuff directory where you will see:
    Something.java exists.
    Then you ask the java compiler to compile your code with:
    javac something.java
    which creates something.class
    [look familiar from the first line    class something{  etc.
    then run the program with:
    java something   [ it knows to only run a .class file]
    Is this the level of information which youseek??
    Hope so!
    Remember! Stay in the Puzzle Somehow!

Maybe you are looking for

  • Compatibility of an editor made in javascript with WebDynpro

    Currently we are using a textarea for the content for the text of a chapter in an application. Of course end-users would like to have a rich text editor since the result is stored as PDF file, so since we use MVC and BSPs our first thought was to use

  • Items not appearing..

    Hi! I  have created a syncBO of type t01..It uses two bapi wrappers GetList and GetDetails..I have created them.They are RFC enabled and are working fine. I am developing it for learning purpose.Here the GetList bapi wrapper will display the differnt

  • Sort and filer a binded collection in a ListBox

    Hello, in my application, I have a listbox which is binded to a collection of objects. Collection element is of Student type and each student is having a 'Name' property which is displayed in the ListBox item. Now I want to add a filter and sort func

  • Is 'Contribute' included in the new Adobe cloud package?

    Dear Adobe Community. I have recently upgraded to Mac OS 10.8.2 (mountain lion) and can no longer use my 'CS4' Muti user licence. Before I go ahead and repurchase a new 'Contribute' licence only - I checked the new Adobe Cloud package (as it seems va

  • Incoming payments thorugh different tender types

    Hi All I have a business scenario here…need your expertise We are using IS retail ECC 06 version. Our customer has retail stores accross the country..for accessory sale and other articles they are going through point of sale(POS) and for furniture sa