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 2 of 2

Thread: JavaCompilerobject giving an error WITHOUT ide

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Location
    Manipal, India
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default JavaCompilerobject giving an error WITHOUT ide

    I am writing a program, where i need to compile one java file from within another, on the fly.

    the code is correct, and is working correctly under BlueJ. but when i export a jar file, or run it from the command-line, it gives me a null-pointer exception!! PLS HELP!!!

    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
               if(compiler.run(null, null, null, "Hello.java")
               {}
               else
               {}


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: JavaCompilerobject giving an error WITHOUT ide

    it gives me a null-pointer exception
    Its tough to give any advice given the code posted and a lack of any stack trace that references said code. Recommend you post an SSCCE which clearly demonstrates the problem.

Similar Threads

  1. web service client giving ClientTransport Exception
    By Veronica in forum Web Frameworks
    Replies: 0
    Last Post: February 10th, 2011, 03:22 AM
  2. SAAJ giving exception with large attachments
    By Veronica in forum Web Frameworks
    Replies: 2
    Last Post: January 4th, 2011, 04:13 AM
  3. Vector Addition with small numbers giving NaN
    By Zula in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 28th, 2010, 09:29 PM
  4. [SOLVED] Giving Java the name of a file to be read via command line?
    By lavloki in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: October 14th, 2010, 10:07 AM
  5. Replies: 0
    Last Post: March 5th, 2010, 01:32 AM

Tags for this Thread