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

  • Home
  • SEARCH
  • 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 6076369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:35:59+00:00 2026-05-23T10:35:59+00:00

I am having an inexplicably hard time doing something that I thought was simplicity

  • 0

I am having an inexplicably hard time doing something that I thought was simplicity itself. I have a JAR file on my classpath. I’m in Emacs, using a SLIME REPL, and I’m trying to access a static field of an instance of a Java class (one inside the JAR).

Here’s my class:

public class MainFrame extends JFrame implements WindowListener,
        TreeSelectionListener {
    JPanel panel;
    InfocardWindow infoWindow;
    InfocardBuilder infocardBuilder;
    Main infomlFile;
    static NotecardModel setupModel;
    ...

When I tried:

infwb.cardmaker> (import 'javax.swing.JFrame)
javax.swing.JFrame
infwb.cardmaker> (import 'org.infoml.infocardOrganizer.MainFrame)
org.infoml.infocardOrganizer.MainFrame
infwb.cardmaker> MainFrame/setupModel
; Evaluation aborted.

The error message was:

Unable to find static field: setupModel in class org.infoml.infocardOrganizer.MainFrame
  [Thrown class java.lang.Exception]

I tried switching to a simpler problem: accessing a non-static field. I did it inside a let, to eliminate the possibility that doing this from the REPL might be the source of the problem:

infwb.cardmaker> (let [mainFr (MainFrame.)]
  (println (.panel mainFr)))
; Evaluation aborted.

The error message was:

No matching field found: panel for class org.infoml.infocardOrganizer.MainFrame
  [Thrown class java.lang.IllegalArgumentException]

I got the same result when substituting (.panel mainFr) and (println (. mainFr panel) in the body of the let. Also, no change when switching the REPL to namespace user. (Granted, these are shake-a-dead-chicken voodoo desperation moves.)

Google queries like ’emacs slime clojure unable to access Java class field error “Unable to find static field”‘ yield nothing useful–most have to do with trying to call Java class methods (not access Java class fields).

Just to be thorough, I tried:

user> (let [mainFr (MainFrame.)]
  MainFrame/setupModel)
; Evaluation aborted.

The error message was, as before:

Unable to find static field: setupModel in class org.infoml.infocardOrganizer.MainFrame
  [Thrown class java.lang.Exception]

Bottom line: Given an instance of MainFrame, what do I need to do to access either a static or non-static field? Thanks for any help or hints you can provide.

  • 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-23T10:35:59+00:00Added an answer on May 23, 2026 at 10:35 am

    Read the Controlling Access to Members of a Class tutorial. You’ll find that you need to either use the public modifier, or be aware that since there is no modifier (the default, also known as package-private), it is visible only within its own package.

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

Sidebar

Related Questions

Having a heckuva time with this one, though I feel I'm missing something obvious.
Having spent some time working on data warehousing, I have created both ETL (extract
Having hard time figuring out how to take the returned orm object and converting
Having programmed through emacs and vi for years and years at this point, I
Having this route: map.foo 'foo/*path', :controller => 'foo', :action => 'index' I have the
I am having trouble sorting an array that includes undefined elements (a sparse array)
having a file with the following for example: DEFINE('INTERESTS_1','a'); DEFINE('INTERESTS_2','d'); DEFINE('INTERESTS_3','g'); DEFINE('INTERESTS_4','c'); Is it
I have a project that I wrote in PHP/symfony that uses 45 tables. I'm
Having a problem with Scala import. I have an import problem with two classes.
I'm having some inexplicable behaviour using jQuery 1.4.2, and I'm beginning to think that

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.