Results 1 to 3 of 3
  1. #1
    MrNice is offline Member
    Join Date
    Jan 2014
    Posts
    16
    Rep Power
    0

    Default Java enviroment not storing in strig

    Hi i got a big headake..

    Java Code:
    System.out.println("1: No way");
    			//String userHomePath;
    			String abc = System.getenv().get("APPDATA");
    			//System.out.println(System.getenv("APPDATA"));
    			System.out.println("2:" + "abc");
    			//File file = new File("userHomePath");
    			
    			Map<String, String> env = System.getenv();
    			String envc = env.get("APPDATA");
    			System.out.println("3:" + envc);
    			
    			String env2 = System.getenv().get("APPDATA");
    			System.out.println("4:" +env2);
    Gives output:
    1: No way
    2:abc
    3:C:\Users\xx\AppData\Roaming
    4:C:\Users\xx\AppData\Roaming

    I dont undestand difrence betwen 2 and 4??

    Was trying to get APPDATA but didin'y work correctly, after 1 hour u found but i don't understand what is going on with......

  2. #2
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,779
    Rep Power
    5

    Default Re: Java enviroment not storing in strig

    In (2) you printed the string "abc" and not the variable, abc. At least I presume that is what you
    are referring to.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    MrNice is offline Member
    Join Date
    Jan 2014
    Posts
    16
    Rep Power
    0

    Default Re: Java enviroment not storing in strig

    Ohh my bad i didn't saw this thx, but alll are copy and paste from examples... I am blind....

Similar Threads

  1. Set Up Java Enviroment
    By lineker in forum New To Java
    Replies: 1
    Last Post: 12-14-2013, 01:15 AM
  2. setting up java enviroment
    By vastrolorde in forum New To Java
    Replies: 15
    Last Post: 08-22-2013, 10:01 AM
  3. Replies: 1
    Last Post: 11-19-2012, 10:58 AM
  4. Xuggle and enviroment variables
    By javment in forum Advanced Java
    Replies: 3
    Last Post: 11-03-2010, 07:20 PM
  5. Replies: 5
    Last Post: 08-26-2009, 11:59 AM

Posting Permissions

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