Results 1 to 12 of 12
  1. #1
    Spindraft is offline Member
    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0

    Default Issues With Config??

    I am reading Sam's Teach Yourself Java as an introduction to the basics of Java coding. I have just downloaded the JDK7u9\jdk1.7.0_09 development kit and working the intitial task of writing, saving and running a simple text program. I store all of the new Java files on an external hard drive (F). I have set the Path in enviroments, saved the code as a .java file but when I try to compile the file I get errors.

    Here is the code I wrote

    class Saluton {
    public static void main(String[] arguments) {
    String greeting = "Saluton mondo!";
    System.out.println(greeting);
    }
    }

    Here is where I set the Path Issues With Config??-path-properties.jpg

    Here are the command prompt attempts to open and/or compileIssues With Config??-prompt-issues.jpg

    Here is the way it was originally savedIssues With Config??-save-screen.jpg

    I am following the book to the letter so do not understand where I am having the promblem. The only thing that worked right was the version check which confirms the version that is on drive "F". The version on drive "C" is different and not the one I am using for coding.

    Any help will be much apreciated.

    Thanks, Spin

  2. #2
    Toll's Avatar
    Toll is offline Senior Member
    Join Date
    May 2011
    Location
    Sweden
    Posts
    392
    Rep Power
    4

    Default Re: Issues With Config??

    You can't just CD to another drive. Try using F: first, and then CD F:\etc.

  3. #3
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default Re: Issues With Config??

    The issue is they are attempting to CD to a Java file and not the directory containing the java file.

  4. #4
    Spindraft is offline Member
    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0

    Default Re: Issues With Config??

    I can't change the C:\Users\Mike Mullen part. It has been on this comp since Ive owned it and I cannot get rid of it. I am not trying to CD "TO" F:, I am tryiong to open a file that is contained on drive "F". I have tried accessing the directory file in every way I know. Im not sure what you guys are seeing that I am not. The guide clearly states that to open a saved file type the following CD C:\filename Since my files are on another drive it would sem logical to me to type CD F:\filename.

    I can relate to what TOLL is saying but again I am doing that. I believe the first command for C: is messing it up although I dont get the error if I type the entire path through each folder.

  5. #5
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default Re: Issues With Config??

    CD is the change directory comman and has nothing to do with opening a file. What do yo mean by "opening"? Viewing the file in a text editor or actually running the Java program?

    Anyhoo, what you need to do is change to the directory containing your .java file. Compile the Java program by typing: javac MyProgram.java
    If there are no errors/problems then MyProgram.class file should be created. Do a ls command to confirm. Then run by typing: java MyProgram

  6. #6
    Toll's Avatar
    Toll is offline Senior Member
    Join Date
    May 2011
    Location
    Sweden
    Posts
    392
    Rep Power
    4

    Default Re: Issues With Config??

    Did you try to just use F: instead of CD F:? Because unless you can get to the correct folder in your command prompt, it will be a lot harder.

    And no, C:\Users\Mike Mullen is not messing it up. It's just the default folder. For instance, try to CD \ and you should instead see C:\> (assuming the correct privileges and whatnot).

  7. #7
    Spindraft is offline Member
    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0

    Default Re: Issues With Config??

    This is one page in the book I am reading, it discusses opening and creating folders
    Sams Teach Yourself Java 2 in 24 Hours | Configuring the Software Development Kit | InformIT

    As for the directory that holds the .java file, they are listed in the example above. Path as such F:\JAVA Development\Java24work\Saluton.java

    I understand file paths but I am obviously missing any other meaning of the word directory as I have tried to compile the Saluton.java file exactly as you have described and it tells me that javac is not recognized.

  8. #8
    Spindraft is offline Member
    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0

    Default Re: Issues With Config??

    Quote Originally Posted by Toll View Post
    Did you try to just use F: instead of CD F:? Because unless you can get to the correct folder in your command prompt, it will be a lot harder.

    And no, C:\Users\Mike Mullen is not messing it up. It's just the default folder. For instance, try to CD \ and you should instead see C:\> (assuming the correct privileges and whatnot).
    It says that F:\javac is not recognized. I set the path in eviroments to identify the JAVA.exe file which is in the same \bin as the javac. ??

  9. #9
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default Re: Issues With Config??

    If you are getting the javac is not recognized error then you have not update your path correctly. One thing to note is that if you have a command window open before making changes to the path it will not see those changes. You must close the command prompt and re-open after changing the path.

  10. #10
    Spindraft is offline Member
    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0

    Default Re: Issues With Config??

    Ok, The path is entered like this

    F:\jdk1.7.0_09\bin It is my understanding that this should allow the javac and any other files in the bin folder to be findable by the program. This is not happening.

    I closed the command window and reset the path, this did not work. I am using a guide from I believe 2003 so I am now of the opinion that the book and the latest JDK are not on the same page. Is there a better instructional book for the fundamentals of using JDK 7u9.
    Last edited by Spindraft; 11-02-2012 at 03:32 AM.

  11. #11
    sibernewf is offline Member
    Join Date
    Mar 2011
    Posts
    48
    Rep Power
    0

    Default Re: Issues With Config??

    ok, I may have this all wrong,
    but java appears to be installed ok.
    When you typesd java -version you received a result.
    So the installation is ok.

    I think what you are after is the following:

    javac F:\JAVA Development\Java24work\Saluton.java

    It may be easier to actually type the following tho:

    F:
    cd JAVA Development\Java24work
    ** I'm not sure how it will deal with spaces between words tho.

    and from here just type java blah blah or javac blah blah.

    Hope that helps.

  12. #12
    Spindraft is offline Member
    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0

    Default Re: Issues With Config??

    Thanks sibernewf, I thought about putting javac in front of the F: but it just seemed like a really wierd thing to do. If it keeps up after that I will get rid of the spacing in file names.

    Tried the above suggestions and still no luck. I am running a version with NetBeans built in so I searched for a better intro book for beginners.

    Here is the link http://www.homeandlearn.co.uk/java/java.html

    They are using JDK 6 with NetBeans as the main editor and it works great. I can even call up and run programs with the command prompt with zero issues. Looks like a pretty good starting place for newcomers to JAVA Programming.

    Thanks for all the help everyone.
    Last edited by Spindraft; 11-02-2012 at 05:39 AM.

Similar Threads

  1. structs config file
    By gani in forum Struts
    Replies: 2
    Last Post: 07-11-2012, 10:41 AM
  2. Struts.config problem
    By legolad in forum Struts
    Replies: 0
    Last Post: 05-31-2012, 06:41 PM
  3. tools4j-config
    By java software in forum Java Software
    Replies: 0
    Last Post: 02-05-2012, 06:56 PM
  4. Tomcat 5.0 and struts-config.xml
    By ajeeb in forum Advanced Java
    Replies: 1
    Last Post: 06-07-2009, 05:53 PM
  5. struts-config.xml
    By Heather in forum Web Frameworks
    Replies: 2
    Last Post: 01-17-2008, 12:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •