Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Problem with Java Path.

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem with Java Path.

    JAVA_PATH in my code is set to "C:\Program Files\Java\jdk1.7.0"
    Since the path has spaces, double quotes is used while assigning the path to the variable JAVA_PATH. I am executing the command from .bat file as follows-

    set JAVA_PATH="C:\Program Files\Java\jdk1.7.0"
    set COMMAND_EXEC=%JAVA_PATH%\bin\java -Xmx1024m ...(classpath and program to execute)
    call %COMMAND_EXEC%

    Executing the above command is not initiating the process and is showing error as "The system cannot find the file -Xmx1024m"

    Can someone suggest on this ?


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,391
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: Problem with Java Path.

    What happens when you run the command in the command line directly?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    May 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problem with Java Path.

    When I run the same in command line, initiates the process without any errors....I wonder how this is happening ? Does the issue lie in evaluating the variables ?

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,391
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: Problem with Java Path.

    Sounds like you have a syntax problem in your .bat file then. This is more a scripting question than a Java question. Might want to google how to pass arguments into a script like that.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. [SOLVED] java -jar path problem
    By lostbits in forum What's Wrong With My Code?
    Replies: 11
    Last Post: October 18th, 2013, 10:24 AM
  2. How to convert local path drive to UNC path
    By krisswift in forum Object Oriented Programming
    Replies: 2
    Last Post: November 17th, 2011, 07:40 AM
  3. Relative path issue with Context path struts
    By chinnu in forum Web Frameworks
    Replies: 1
    Last Post: March 31st, 2011, 10:17 AM
  4. how to get full path name from realtive path
    By priyanka3006 in forum File I/O & Other I/O Streams
    Replies: 8
    Last Post: August 10th, 2009, 04:28 AM
  5. [SOLVED] How to a set java class path?
    By captjade in forum Java Theory & Questions
    Replies: 1
    Last Post: March 10th, 2009, 06:40 AM

Tags for this Thread