Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6818271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:09:29+00:00 2026-05-26T21:09:29+00:00

package com.scheduler.process; public class Process { public enum state { NOT_SUBMITTED, SUBMITTED, BLOCKED, READY,

  • 0
package com.scheduler.process;

public class Process {
    public enum state {
        NOT_SUBMITTED, SUBMITTED, BLOCKED, READY, RUNNING, COMPLETED 
    }
        private state currentState;

    public state getCurrentState() {
        return currentState;
    }

    public void setCurrentState(state currentState) {
        this.currentState = currentState;
    }

}



package com.scheduler.machine;
import com.scheduler.process.Process;
import com.scheduler.process.Process.state;

public class Machine {
    com.scheduler.process.Process p = new com.scheduler.process.Process();
    state s = state.READY;  //fails if I don't also explicitly import Process.state
    p.setCurrentState(s);  //says I need a declarator id after 's'... this is wrong.
    p.setCurrentState(state.READY);
}

Modified the example to try and direct to the issue. I cannot change the state on this code. Eclipse suggests importing Process.state like I had on my previous example, but this doesn’t work either. This allows state s = state.READY but the call to p.setCurrentState(s); fails as does p.setCurrentState(state.READY);

Problem continued…. Following Oleg’s suggestions I tried more permutations:

package com.scheduler.machine;
import com.scheduler.process.Process;
import com.scheduler.process.Process.*;

public class Machine {
    com.scheduler.process.Process p = new com.scheduler.process.Process();
    public state s = Process.state.READY;  
    p.setCurrentState(s);
    p.setCurrentState(state.READY);
}

Okay. It’s clear now that I’m a candidate for lobotomy.

package com.scheduler.machine;

import com.scheduler.process.Process;
import com.scheduler.process.Process.state;

public class Machine {

    public void doStuff(){
        com.scheduler.process.Process p = new com.scheduler.process.Process();
        state s = state.READY;  //fails if I don't also explicitly import Process.state
        p.setCurrentState(s);  //says I need a declarator id after 's'... this is wrong.
        p.setCurrentState(state.READY);
    }

}

I needed to have a method in the class–but we’re still missing something (probably obvious) here. When I go via the command line and run javac on the Machine class AFTER compiling Process, I still get the following error:

mseil@context:/media/MULTIMEDIA/Scratch/Scratch/src/com/scheduler/machine$ javac Machine.java
Machine.java:3: package com.scheduler.process does not exist
import com.scheduler.process.Process;
^

So I guess the question now becomes, what idiot thing am I missing that is preventing me from compiling this by hand that eclipse is doing for me behind the scene?

======
Problem solved here:
Java generics code compiles in eclipse but not in command line

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:09:29+00:00Added an answer on May 26, 2026 at 9:09 pm

    Eclipse doesn’t use the Sun JDK by default. I would assume that you are using Eclipse’s built in compiler as Sun’s JDK and the OpenJDK are almost identical.

    Java code compiles and runs exact the same on Windows and Linux most of the time (unless you use a few of the platform specific operations)

    I suspect you are not building the code the same way and when you compile Machine, the Process class has not been compiled.

    I suggest you use a standard build system like maven or ant and it will build the same everywhere. Failing that run Eclipse on Linux or just the same .class you use on windows as they don’t need to be re-compiled in any case.

    BTW: You don’t need to import Process.state as it not used and its in the same package (so you wouldn’t need to if you did)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please consider the following java source: package com.stackoverflow; public class CondSpeed { private static
SampleBean: package com.springexample; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; public class SampleBean { private BeanTypeOne beanOne;
I have the following Model class: package com.swaranga.model; public final class Book { private
package com.mycontainer; public class MyContainer { private static ContainerConfig cConfig; private MyContainer() { }
package com.valami; public class Ferrari { private int v = 0; private void alam()
This is the code: package com.XXX; public final class Foo { private Foo() {
This confuses me. The following compiles fine under Eclipse. package com.example.gotchas; public class GenericHelper1
I created the following abstract class for job scheduler in red5: package com.demogames.jobs; import
package com.test; public class OuterClass { public class InnerClass { public class InnerInnerClass {
package com.test01; public class test01 { public static void main(String[] args) { System.out.println(hi); }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.