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 9109803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:07:44+00:00 2026-06-17T03:07:44+00:00

I would like to use a class from some project in another Java Web

  • 0

I would like to use a class from some project in another Java Web project. Unfortunately I don`t know what I have do to call this class. I understand I have to write package etc. but how?

This class is visible in Java website project

public class MojaWygenerowanaKlasaa {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
 Test2 test2 = new Test2();
String Zmienna = test2.query2();
    }
    // public string Query2() {
      //      return jpsquerie1.dana;
        //}

}

This class is visible in another project SBQL4J_EXAMPLE1 -> file(src) -> package -> example

package example;

public class Test2 {
    public String query1(){

        return "aa";
    }
}

I added the project here.

  • 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-06-17T03:07:45+00:00Added an answer on June 17, 2026 at 3:07 am

    As I see you have already added the project that contains classes you need to another project’s build path (“Required projects on the build path” on the picture above).

    Now in the file that needs that class just import that class.

    Example:

    import pl.example.SomeClass;
    
    public class Test {
      ...
    
      public static void main(String[] args) {
        SomeClass someClass = new SomeClass();
        ...
      }
      ...
    
    }
    

    In other words, you can freely acces all classes that are on the project’s build path in a standard way.

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

Sidebar

Related Questions

I have some Python Scripts which I would like to use from my VB.NET
I have a class that I would like to use in a scala.collection.mutable.PriorityQueue, but
I have a container class which I would like to use to print all
I have a class which is intended for immutable use, hence I would like
I have a C++ class that I would like to use in my Objective-C
I would like to use the following class across multiple modules without needing log
I would like to use the .navbar-search class in Boostrap, but I would like
I would like to use different instances of an STL custom allocator class to
I'm using the CCNode class in cocos2d and would like to use its schedule:interval:
I would like to ask couple of Questions regarding the use of Monitor Class

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.