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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:21:54+00:00 2026-06-04T06:21:54+00:00

So far I have only used standard libraries in my programs. I’m just making

  • 0

So far I have only used standard libraries in my programs. I’m just making a simple console application and I’m not using any IDE, just simple text editor (because I don’t need anything more complex at the moment).

I don’t know where to put jar file I’ve downloaded and I also don’t know how to call it correctly. I’ve read something about include path? But I’m not sure if I understand.

I just have simple folder structure like so:

  • Project
    • Class.java
    • Class.class
    • gson-2.2.1.jar

I’ve tried with this:

import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonParser;

But I get that it doesn’t exist.

  • 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-04T06:21:56+00:00Added an answer on June 4, 2026 at 6:21 am

    This answer assumes you are using the javac and java commands in a *nix environment.

    To compile your code you need to put the jar and your Java files on to the classpath with the -cp flag. For this small example, you really only need to provide the Java file that has your main method. This is because the compiler will look for any Java files it needs to compile along with YourClass.java by searching for them on the classpath.

    javac -cp /path/to/java/files:/path/to/gson-2.2.1.jar YourClass.java
    

    To run your code you need to do the same thing but only refer to the class with your main method.

    java -cp /path/to/class/files:/path/to/gson-2.2.1.jar YourClass
    

    Keep in mind that the /path/to/java/files and /path/to/class/files directories must point to the root directory of your packages (if you using packages, which you should).

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

Sidebar

Related Questions

I only have a vague hint of spec so far, but I'm just testing
I have a semi-comprehensive KO setup. But so far I have only used KO
Thus far i have only used glDrawArrays and would like to move over to
I so far only have the interface builder layout I'm not clear on the
So far the only way I have been able to keep index.yaml updated when
using chrome and ff so far have made a nasty glitch when using scrollTo
So far I have not been able to find an answer, but I wanted
So far I have learned about generating thread dump and heap dump using jstack
I am implementing IQueryable, and so far have only implemented an expression visitor for
so far I have done most view programming in code, but it really is

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.