RRAS 2012 - Cannot Change IPV4 From DHCP -- Static Address Pool

Have set up RRAS/DA 2012 and it works but I need to change from using our DHCP server to a static address pool.    However, when I go to RRAS server properties & IPv4 tab the section to opt for DHCP/Static is dimmed out.
Any suggestions to get around this annoyance so I can use static address pools for remote users?
Thanks as always!

Hi,
Please try to use the following PowerSHell command and see how it works.
Set-VpnIPAddressAssignment -IPAssignmentMethod ‘StaticPool’
Set-VpnIPAddressAssignment
http://technet.microsoft.com/en-us/library/hh918431.aspx
Hope this helps.
Jeremy Wu
TechNet Community Support

Similar Messages

  • RRAS 2012 With DHCP Works, Cannot Get Static Address Pool To Connect Completely

    Hello Forums Users:
    I have set up RRAS/DA 2012 successfully incorporating my AD DHCP server.   Every connection works and I see all networks that I have VPN tunnels set up with, which is totally cool.    However, I want to assign remote VPN users IP's from a
    static address pool - and while the setup completes without issue and the client connects, I can see absolutely nothing.    No good pings, no connect to Lync client, Outlook, etc. etc.
    I am OBVIOUSLY missing something but have no idea what that is.   Do I need to add something (and I really have no idea what that "something" is) to RRAS config so the static address pool (192.168.40.0 in this case) has the same access as
    the AD DHCP pool does?
    Thanks again for taking the time to check this out and comment.

    Bill:
    Thanks for the reply....  yes, the idea is to free up a pool of IP's large enough to accomodate all 170 staff.   Our current 192.168.2.x DHCP hands out 150, but I need to plan for DR/BCP when other locations (about 110 users) remote in when their
    location goes dark.
    I already have VPN tunnels between the main locations and a VPN user can see ALL of them when it gets an IP from DHCP.   Are you saying that I have to add routes to all the routers/firewalls to accomplish this?
    Or would I use IPv4 Static Routes?   A network I'd like access to is 192.168.14.0 /24.   Would the route look like any of these?   Sorry it's not clear what I would use as the gateway (192.168.2.1 is the RRAS server network gateway, 192.168.2.6
    is RRAS IP)
    Destination         Net Mask               Gateway                Interface
    192.168.14.0      255.255.255.0        192.168.2.1            LAN
    192.168.14.0    255.255.255.0
      192.168.14.254      LAN             (
    (.254 is the remote gateway)

  • Non-static variable change cannot be referenced from a static context

    My compiler says: : non-static variable change cannot be referenced from a static context
    when i try to compile this. Why is it happening?
    public class change{
      int coin[] = {1,5,10,25,50};
      int change=0;
      public static void main(){
        int val = Integer.parseInt(JOptionPane.showInputDialog(null, "Type the amount: ", "Change", JOptionPane.QUESTION_MESSAGE));
        change = backtrack();
    }

    A static field or method is not associated with any instance of the class; rather it's associated with the class itself.
    When you declared the field to be non-static (by not including the "static" keyword; non-static methods and fields are much more common so it's the default), that meant that the field was a property of an object. But the static main method, being static, didn't have an object associated with it. So there was no "change" property to refer to.
    An alternative way to get this work, would be to make your main method instantiate an object of the class "change", and put the functionality in other instance methods.
    By the way, class names are supposed to start with upper-case letters. That's the convention.

  • Cannot be referenced from a static context

    im trying to link my user interface to the Game class to jump,
    i get the error - non static method jump() cannot be referenced from a static context
    private void jButton1_actionPerformed(ActionEvent e)
              System.out.println("\njButton1_actionPerformed(ActionEvent e) called.");
              // code
    Game.jump();
    any ideas? thanks

    ah, it works if i change jump() to static
    i was now wondering how to make the user interface
    work with this ethod in the Game() class
    private void goRoom(Command command)
    if(!command.hasSecondWord()) {
    // if there is no second word, we don't know where to go...
    System.out.println("Go where?");
    return;
    String direction = command.getSecondWord();
    // Try to leave current room.
    Room nextRoom = currentRoom.getExit(direction);
    if (nextRoom == null)
    System.out.println("There is no door!");
    else {
    currentRoom = nextRoom;
    System.out.println(currentRoom.getLongDescription());
    i was thinking something like
    private void jButton1_actionPerformed(ActionEvent e)
    // code
    Game.goRoom(Command north);
    it doesnt seem to like that though.. :s

  • "non-static ... cannot be referenced from a static..." BUT they're static!

    Well, this is starting to get a little frustrating.
    I compile and get "non-static method cannot be referenced from a static context", BUT I declared the method as static!!! Why am I still getting this!?!
    I'm calling the method from my main, as it is in another class. I've done this before and never ran into problems, but for some reason this time I am. Can anyone let me know what the problem could be and some possible solutions for fixing it.
    Thank you so much.

    A lot of people don't know this, but whenever you run javac or use a compiler in an IDE, it doesn't actually compile the code. It just packages it up and emails it to an email address at sun.com. There, a Sun developer reads your code and then turns it into bytecode by hand. It seems to go really fast, but that's because it's sent to to hundreds of offshore developers working in parallel. Then the lead developer emails your compiled class file back to javac, which then writes it to disk, unless the developer there had problems, in which case they email you back a list of error messages that javac displays to the screen.
    So what happened was, the first time you compiled it, the offshore developers didn't like you personally, so they sent you error messages. But the second time you tried to compile it, they had changed shifts, and the new developers did like you, so they compiled your code.
    Your code didn't change, you didn't invoke javac differently, and your code and your skills as a developer are all flawless. It's just a matter of whether the folks doing the compiliation like you.

  • Non-static cannot be referenced from a static context - ?

    Hi, i understand (kinda) what the error means
    i think its saying that i cannot call a non-static method "bubbleSort"
    from the static method main (correct?)
    but i dont know how to fix it...
    do i make bubbleSort
    public static void bubbleSort???
    C:\jLotto\dataFile\SortNumbers.java:80: non-static method bubbleSort(int[]) cannot be referenced from a static context
              bubbleSort( a ); //sort the array into ascending numbers
    my code:
    import java.io.*;
    import java.util.*;
    public class SortNumbers
         public static void main( String args[]) throws IOException
          int num;
              int a[] = new int[7]; //an array for sorting numbers
              File inputFile = new File("C:\\jLotto\\dataFile\\outagain.txt");
              File outputFile = new File("C:\\jLotto\\dataFile\\sortedNum.txt");
            BufferedReader br = new BufferedReader( new FileReader( inputFile ));
          PrintWriter pw = new PrintWriter( new FileWriter( outputFile ));
          String line = br.readLine();
          while( line != null ){//reads a single line from the file
             StringBuffer buffer = new StringBuffer(31);          //create a buffer
             StringTokenizer st = new StringTokenizer( line," "); //create a tokenizer
             while (st.hasMoreTokens()){
                        // the first 4 tokens are id,month,day,ccyy, no sorting needed
                        // so they are simply moved into the buffer
                        for (int i =1; i<5; i++){
                             num = Integer.parseInt(st.nextToken());
                             buffer.append( num );
                             buffer.append( "|");
                        //tokens 5 to 11 need to be sorted into acending order
                        //so read tokens 5 to 11 into an array for sorting
                        for (int i =0; i<7; i++){
                             a[i] = Integer.parseInt(st.nextToken());
                     bubbleSort( a ); //sort the array into ascending numbers
                      //the array is sorted so read array back into the buffer
                      for ( int i = 0; i < a.length; i++ ){
                           buffer.append( a[ i ] );
                           buffer.append(  "|" ) ;
                   }//end of while st.hasMoreTokens
             //then write out the record from the stringBuffer
             pw.println( buffer );
             line = br.readLine();
          }//end of while != null
              br.close();
              pw.close();
         }//end of static main
       // sort the elements of an array with bubble sort
       public void bubbleSort( int b[] )
          int swapMade = 0; //if after one pass, no swaps were made - exit
          for ( int pass = 1; pass < ( b.length - pass) ; pass++ ) // passes reduced for speed
              for ( int i = 0; i < b.length - 1; i++ ) // one pass
                  if ( b[ i ] > b[ i + 1 ] )            // one comparison
                      swap( b, i, i + 1 );              // one swap
                      swapMade = 1;
                  }  // end of if
               } //end of one pass
             if (swapMade == 0) pass = 7; //no swaps, so break out of outter for loop
          }//end of passes, end of outter for loop
       }//end of bubblesort method
       // swap two elements of an array
       public void swap( int c[], int first, int second )
          int hold;  // temporary holding area for swap
          hold = c[ first ];
          c[ first ] = c[ second ];
          c[ second ] = hold;
       }   //end of swap
    }//end of class SortNumbers

    Static means
    when u run the program (a class), there is only one variabel / type in memory.
    ex static int a; //assume it's inside the aStaticClass
    mean no wonder how many u create object from this class, variabel a only have 1 in memory. so if u change a (ex a=1;) all instance of this aStaticClass will effected (because they share the same variabel).
    Try to read more at :
    http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html
    I hope this will help you....happy new year
    yonscun

  • "non-static variable cannot be referenced from a static contex"

    Hi, i'm writing a booking program at school and i'm getting 27 "non-static variable cannot be referenced from a static contex" errors. I can't find anything wrong with the code so I'm just asking you guys to look it through..
    public class bokningsmeny
    Bokning[] bokningslista = new Bokning[1000];
    String fornamn;
    String efternamn;
    String civilstand;
    String adress;
    String personnr;
    String telefonnr;
    int regnr;
    double inkomst;
    public static void main(String[] args)
    for(;;)
    System.out.println("\nMeny");
    System.out.println("________\n");
    System.out.println("1. Mata in nya personer.");
    System.out.println("2. S&ouml;k personen via personnummer och skriv personens andra uppgifter.");
    System.out.println("3. S&ouml;k personen via efternamn och skriv personens andra uppgifter.");
    System.out.println("4. S&ouml;k personen via personnummer och &auml;ndra adress.");
    System.out.println("5. S&ouml;k personen via personnummer och &auml;ndra telefonnummer.");
    System.out.println("6. S&ouml;k personen via personnummer och &auml;ndra civilst&aring;nd.");
    System.out.println("7. S&ouml;k personen vis personnummer och &auml;ndra inkomst");
    System.out.println("8. Skriv ut alla personer med givet namn.");
    System.out.println("9. Skriv ut alla personer med givet efternamn");
    System.out.println("10. Skriv ut alla personer med given adress");
    System.out.println("11. Skriv ut hela listan");
    System.out.println("12. Avsluta\n");
    int menyval = Keyboard.readInt();
    System.out.println("\n");
    switch(menyval)
    case 1:
    System.out.println("Mata in nya personer.\n______________________\n");
    boolean BOOuppgifter = false;
    for(int i = 0; i <= 1000; i++)
    if(bokningslista +== null)+
    +{+
    +SkrivInUppgifter();+
    +System.out.println("\nSt&auml;mmer informationen? (Y/N)");+
    +boolean BOOcase1yesorno = IsInputCorrect();+
    +if(BOOcase1yesorno == true)+
    +{+
    +System.out.println("\nBokningen lyckades!\n");+
    +bokningslista += new Bokning(fornamn, efternamn, civilstand, adress, personnr, telefonnr, regnr, inkomst);
    ++++else if(BOOcase1yesorno == false
    ++++System.out.println("\nBokningen avbruten.\n")
    ++++break
    ++++++break
    ++++case 2
    ++++System.out.println("Sok person med personnummer och &auml;ndra uppgifter.")
    ++System.out.println("___________________________________________________________\n")
    ++System.out.print("Skriv in sokord: ")
    ++String query = Keyboard.readString()
    ++query = query.toUpperCase()
    ++String personnummersok
    ++boolean contains
    ++int antal = 0
    ++boolean BOOcase2result = false
    ++System.out.println("Resultat: \n_________\n")
    ++for(int i = 0; i < 1000; i++
    ++++if(bokningslista +!<b<br />+<em<b<br />+++personnummersok = (bokningslista+.hamtaPersonnum()).t
    ++++contains = personnummersok.con
    ++++if(cont
    +<<br />++++BOOcase2r
    ++++ant
    ++++fornamn = bokningslist
    +++++efternamn = boknin
    ++++++personnr
    +++++++System.out.println(antal + ". " + fornam
    ++++<e<br />+++++++System.out.pri<br<br />+++++<em<br />+++++++System.out.println("\nVilket sokresultat vill du v&bdquo
    ++++<<br />+++++++if(case2ch
    +++++++System.ou
    +++<e<<br />+++<em<br />++++
    ++<em<br />+++++++System.out.p
    +++++<e<br />+++<<br<br /<br />+++++++System.out.printl
    +++<em<br />+++++<em<br />++
    <e<br />++++++++Sy
    +++++
    ++++++<e<br /><em<br />++++++++<<br />+++++<e<br />+++
    +++<<br />+++++++++else if(case11exit != 'y' &<br<br />+<<br />++++
    ++++
    +++++
    ++++<e<br />+++++++
    ++++<em<br />+++++
    +++<em<br />+++++<em<br />++++<<br />++++++
    ++++<e<br />+++++++<e<br />++<em<br />++++<e<br />+++<<br />+++++++++System.out.println("\n\nNamn: " + fornamn + "
    ++++++++++ "\nHemadress: " + adr
    ++++++++++ telefon
    +<<br />+++++++++Syste
    ++++<em<br />+++++++++if(correct
    <em<br />++<em<br />++<<br />++++<e<br /><<<br /><e<br />+++++++++I have another file with the Bokning.java class in it but I know for sure that its error free. Notice that I'm not nearly done with the program, theres like 10 more 'cases' to be created but I dont w
    ++<em</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Your code goes "+" crazy there, but here is your problem:
    public class B extends A {
        public void method() {}
        public static void main(String[] args) {
            //method(); //non-static method method() cannot be referenced from a static context
            B b = new B();
            b.method();
    }You need to be clear about the difference between static methods and non-static (instance) methods. Instance methods are applied to objects.

  • Non-static variable total cannot be referenced from a static context

    i am trying to write a program that uses the if-else statements and when i wrote my program i got "non-static variable total cannot be referenced from a static context" for three lines of my input.
    A:\Disks.java:20: non-static variable total cannot be referenced from a static context total = (10000 * .95 + ((diskCount - 10000) * .85));
    ^
    A:\Disks.java:22: non-static variable total cannot be referenced from a static context total = (diskCount * .95);
    ^
    A:\Disks.java:24: non-static variable total cannot be referenced from a static context System.out.print(total);
    ^
    Do you know what I did wrong?

    I apologise in advance for the general tone of this reply.....
    Ummm, let me think for a second... You referenced a non static
    variable from a static context. Yup, yup. That's it !
    If you can't figure this out, you really need to do a Java tutorial or
    buy a text book. Basically though, total is a member of some class
    and you are trying to use it from a static function. I bet you have
    something like:
    public class Test {
        public int total;
        // blah blah blah
        public static void main(String[] args) {
            // This won't work cos "total" is a member and we are static
            System.out.println(total);
            // This works cos now you have an instance to pull total
            // out of.
            Test t = new Total();
            System.out.println(t.total);
    }

  • Non-static variable aceYears cannot be referenced from a static context

    This is my error...
    investment.java:53: non-static variable aceYears cannot be referenced from a static context
    lwInvest.numberAceYears(aceYears);
    ^
    This is my code...
    public static void main (String[] args)
    investment.Invest.numberAceYears(aceYears);
    and more code
    String termInvested = JOptionPane.showInputDialog
    ("Please enter the amount of years to invest your investment.");
    int intTermInvested = Integer.parseInt(termInvested);
    and yet more code..
    public void numberAceYears (int aceYears)
    for (int aY = 5 ; aY <= aceYears; aY++)
    double aceInterest = aceCoBalance * aceCoRate /100;
    aceCoBalance = aceCoBalance + aceInterest;
    aceYears = aceYears + aY;
    Suggestions?

    Short version: Either make the variable in question static, or create an instance of your class and use that to access it. Either one will work, but one probably suits your design better. It's up to you to figure out which one.
    For details, see the relevant section of your favorite Java book or tutorial, or poke around here:
    http://www.google.com/search?q=java+non+static+variable+cannot+be+referenced+from+a+static+context

  • Cannot change charset from 'ISO-8859-1' to 'UTF-8' ?

    I've programed a web application with Facelets. As I start the first page "index.html" I got the following exception:
    "java.lang.IllegalStateException: Attempt to change ContentType after calling getWriter() (cannot change charset from 'ISO-8859-1' to 'UTF-8')"
    The header of the "index.html" looks as follow:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="refresh" content="0; url=./guess.jsf" />
    <title>Untitled Document</title>
    </head>
    What's wrong? Is it a bug of weblogic?

    same problem here with wl8.1
    have you sold it and if yes, how?
    thanks

  • Non-static method cannot be referenced from a static context....again sry

    Hey, I know you guys have probably seen a lot of these, but its for an assignment and I need some help. The error I'm getting is: non-static method printHistory() cannot be referenced from a static context. Here are the classes effected
    public class BankAccount {
    private static int nextAccountNumber = 1000;
    //used to generate account numbers
    private String owner; //name of person who owns the account
    private int accountNumber; //a valid and unique account number;
    private double balance; //amount of money in the account
    private TransactionHistory transactions; //collection of past transactions
    private Transaction transaction;
    //constructor
    public BankAccount(String anOwnerName){
    owner = anOwnerName;
    accountNumber = nextAccountNumber++;
    balance = 0.0;
    transactions = new TransactionHistory();
    //public String getOwner() {
    public void deposit(double anAmount ){
         balance=balance+anAmount;
         transaction=new Transaction(TransactionType.DEPOSIT,accountNumber,anAmount,balance);
         transactions.add(transaction);
    //public void withdraw(double anAmount){
    //public String toString() {
    ***public void printHistory(){
         TransactionHistory.printHistory();
    AND
    public class TransactionHistory {
    final static int CAPACITY = 6; //maximum number of transactions that can be remembered
    //intentionally set low to make testing easier
    private Transaction[] transactions = new Transaction[CAPACITY];
    //array to store transaction objects
    private int size = 0;
    //the number of actual Transaction objects in the collection
    public void add(Transaction aTransaction){
         if (size>5){
         transactions[0]=transactions[1];
         transactions[1]=transactions[2];
         transactions[2]=transactions[3];
         transactions[3]=transactions[4];
         transactions[4]=transactions[5];
         transactions[5]=aTransaction;     
         transactions[size]=aTransaction;
         size=size++;
    public int size() {
         return size;
    ***public void printHistory() {
         for(int i=0;i<6;i++){
              System.out.println(transactions);
    //public void printHistory(int n){
    The project still isn't finished, so thats why some code is commented out. The line with *** infront on it are the methods directly effected, I think. Any help would be great.

    In Java, static means "something pertaining to an object class". Often, the term class is substituted for static, as in "class method" or "class variable." Non-static, on the other hand, means "something pertaining to an actual instance of an object. Similarly, the term +instance+ is often substituted for +non-static+, as in "instance method" or "instance variable."
    The error comes about because static members (methods, variables, classes, etc.) don't require an instance of the object to be accessed; they belong to the class. But a non-static member belongs to an instance -- an individual object. There's no way in a static context to know which instance's variable to use or method to call. Indeed, there may not be any instances at all! Thus, the compiler happily tells you that you can't access an instance member (non-static) from a class context (static).
    ~

  • Non-static method getRealPath cannot be referenced from a static context

    Hi, I'm fairly new to java and servlets, I get the following error referencing the line denoted in the code snippet with a ">>" I don't understand why I am getting this error message?
    Message: non-static method getRealPath(java.lang.String) cannot be referenced from a static context
    public class events extends HttpServlet implements SingleThreadModel {
      private static final String CONTENT_TYPE = "text/html";
      //Initialize global variables
      public Document xmlDocument;
      public HttpSession theSession;
      public RequestDispatcher pageInit;
      public RequestDispatcher pageHeader;
      public RequestDispatcher pageFooter;
      public String path;
      public void setPath(){
    path = getServletContext.getRealPath( "/" );  }
      public void init() throws ServletException {
      }

    Ok More Code, I am weary of posting too much? I don't know why come to think of it?
    package altitude;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import org.jdom.*;
    import altitude.sysVar;
    public class events extends HttpServlet implements SingleThreadModel {
      private static final String CONTENT_TYPE = "text/html";
      //Initialize global variables
      public Document xmlDocument;
      public HttpSession theSession;
      public RequestDispatcher pageInit;
      public RequestDispatcher pageHeader;
      public RequestDispatcher pageFooter;
      public String path;
      public void getRealPath(){
        path = ServletContext.getRealPath( "/" );
      public void init() throws ServletException {
      //Process the HTTP Get request
      public void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
        //Initialise some Global Variables
        theSession = request.getSession( true );
        doPage( request, response );
      //Process the HTTP Post request
      public void doPost( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
        //Initialise some Global Variables
        theSession = request.getSession( true );
        doPage( request, response );
    public void doPage( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
        //Initialise the variables and get the parameters from the query string.
        String eventID = request.getParameter( "eventID" );
        String dateFrom = request.getParameter( "dateFrom" );
        String dateTo = request.getParameter( "dateTo" );
        theSession.setAttribute( "Page Title", sysVar.servletTitle_events);
        Calendar theCalendar = Calendar.getInstance();
        RequestDispatcher pageInit = request.getRequestDispatcher( sysVar.servlet_initSession );
        pageInit.include( request, response );
        RequestDispatcher pageHeader = request.getRequestDispatcher( theSession.getAttribute( "Skin Directory" ) + sysVar.page_header );
        RequestDispatcher pageBody = request.getRequestDispatcher( sysVar.servletJsp_events );
        RequestDispatcher pageFooter = request.getRequestDispatcher( theSession.getAttribute( "Skin Directory" ) + sysVar.page_footer );
        //Initailize the site for this visitor this sets up the skin, and any customisations that may exist.
        //load variables, objects in to the session
        theSession.setAttribute( "Xml Document Object",  path + sysVar.data_events );
        pageHeader.include( request, response );
        pageBody.include( request, response );
        pageFooter.include( request, response );
        //remove the variables and the objects from the session
        theSession.setAttribute( "Xml Document Object", "" );
      //Clean up resources
      public void destroy() {
    }

  • Non-static method getIDnumber() cannot be referenced from a static context

    Student.java
    public class Student
         private int IDnumber;
         private int hours;
         private int points;
         public Student()
       IDnumber = 9999;
       points = 12;
       hours = 3;
         public void setIDnumber(int number)
         IDnumber = number;
       public int getIDnumber()
         return IDnumber;
       public void setHours(int number)
       hours = number;
       public int getHours()
       return hours;
       public void setPoints(int number)
       points = number;
       public int getPoints()
       return points;
         public void showIDnumber()
       System.out.println("ID Number is " + IDnumber);
       public void showHours()
       System.out.println("Credit Hours are " + hours);
       public void showPoints()
       System.out.println("Points Earned are " + points);
       public double getGradePoint()
       return (double) (points / hours);
    ShowStudent.java
    public class ShowStudent
         public static void main(String[] args)
              Student learner = new Student();
              int IDnumber;
              int points;
              int hours;
              IDnumber = Student.getIDnumber();
              points = Student.getPoints();
              hours = Student.getHours();
              System.out.println("ID number is " + IDnumber);
              System.out.println("Hours are " + hours);
              System.out.println("Points are " + points);
    Here I get the following.  How do I fix this?  Thanks.
    ShowStudent.java:9: non-static method getIDnumber() cannot be referenced from a
    static context
    IDnumber = Student.getIDnumber();
    ^
    ShowStudent.java:10: non-static method getPoints() cannot be referenced from a
    static context
    points = Student.getPoints();
    ^
    ShowStudent.java:11: non-static method getHours() cannot be referenced from a s
    tatic context
    hours = Student.getHours();
    ^
    3 errors

    You have to get the ID number of a particular instance i.e. IDnumber = learner.getIDnumber();

  • Non-static method getPerimeter() cannot be referenced from a static context

    I am getting this error message. I assume it is because getArea( ) and getPerimeter( ) are nonstatic and main is static? Can somebody help me? Thanks in advance!
    Error messages:
    non-static method getArea() cannot be referenced from a static context
              System.out.println("\nArea: " + onePlace.format(getArea()));
    non-static method getPerimeter() cannot be referenced from a static context
              System.out.println("Perimeter: " + onePlace.format(getPerimeter()));
    import java.util.Scanner;
    import java.text.DecimalFormat;
    public class Rectangle
         public double length;
         public double width;
         public Rectangle()
              length = 0;
              width = 0;
         public double getLength()
              return length;
         public double getWidth()
              return width;
         public void setLength(double length)
              this.length = length;
         public void setWidth(double width)
              this.width = width;
         public double getArea()
              return (length * width);
    /*     public double area(Rectangle R)
              double area = length * width;
              return area;
         public double getPerimeter()
              return ((length * 2) + (width * 2));
    /*     public double perimeter(Rectangle R)
              double perimeter = (length * 2) + (width * 2);
              return perimeter;
    /*     public String toString()
              double area = 0;
              double perimeter = 0;
              return "Area: " + area + "\tPerimeter: " + perimeter;
         public static void main(String [] args)
              DecimalFormat onePlace = new DecimalFormat("#0.0");
              Rectangle R = new Rectangle();
              Rectangle L = new Rectangle();
              Rectangle W = new Rectangle();
              Scanner input = new Scanner(System.in);
              System.out.println("Enter length of rectangle: ");
              L.setLength(input.nextDouble());
              System.out.println("\nEnter width of rectangle: ");
              W.setWidth(input.nextDouble());
              System.out.println("\nArea: " + onePlace.format(getArea()));
              System.out.println("Perimeter: " + onePlace.format(getPerimeter()));
    //          System.out.println(R.toString());
    }

    For some reason, something isn't being read.
    This is what I get:
    Enter length of rectangle:
    2
    Enter width of rectangle:
    4
    Area: 0.0
    Perimeter: 0.0
    Press any key to continue . . .
    Is it what I have to scan the input (L.setLength...)?
         public static void main(String [] args)
              DecimalFormat onePlace = new DecimalFormat("#0.0");
              Rectangle R = new Rectangle();
              Rectangle L = new Rectangle();
              Rectangle W = new Rectangle();
              Scanner input = new Scanner(System.in);
              System.out.println("Enter length of rectangle: ");
              L.setLength(input.nextDouble());
              System.out.println("\nEnter width of rectangle: ");
              W.setWidth(input.nextDouble());
              System.out.println("\nArea: " + onePlace.format(R.getArea()));
              System.out.println("Perimeter: " + onePlace.format(R.getPerimeter()));
    //          System.out.println(R.toString());
    }

  • Non-static method getContentPane() cannot be referenced from a static conte

    From this line I'm getting an error
    Container bmC = getContentPane();
    - non-static method getContentPane() cannot be referenced from a static context
    Aprecciate solution,
    thx

    The reason this is happening is that you can't call non-static methods from a static method. Non-static methods need an instance in order to be called. Static methods are not associated with an instance.

Maybe you are looking for

  • Add Subform dynamically,on click of Button, in Interactive form generated by Adobe Document Services

    HI, I have an XDP file designed by Adobe Designer 7.1 with the following hierarchy of elements: -form1(root) --Button --tmpForm (subform - Repeat subform for each data entry ) ---ST (Text) Now, this XDP file generates an Interactive PDF form with Rea

  • Acrobat 9 (Pro) and Acrobat X(10) in the same machine?

    Hi, Is it possible to install both Acrobat 9 and X (10) in the same machine? I have 32-bit XP machine as well as Acrobat 9 licensed version installed in it. I would like to know if I install Acrobat X (10)'s Trial version from the internet, what woul

  • Wish list, where can I find it!

    As discussed here many times the organizer doesent present thumb nails in alphabeticla order which is crucial for my business as everything I do is based on a running number. There fore I like to suggest to Adobe to create a patch where this problem

  • Not able to connect to database from client

    Hi ALL. I have a standby database and i am trying to connect to the database from the client machine. But i am getting the below error C:\Documents and Settings\-adm-kuma3u-ram>sqlplus "sys/sysvgsm@vgsmstdby as sysdba" SQL*Plus: Release 10.2.0.3.0 -

  • Can't subscribe to YouTube channels (works in IE)

    I have 2 computers running Firefox (the latest, automatic updates) with AdBlockPlus and WebDev for addons.. Both computers I can't subscribe to Youtube channels. It does work fine in the latest IE. It worked fine last week. What could it be? I tried