Jump to content

Help - Compile .java classes to .jar [Intellij]


Viston

Recommended Posts

So I'm trying to compile my classes using intellij's artifacts. However, when I go to Project Settings > Artifacts > Jar > From modules to dependencies  > Main Class > *MY CLASS*.

I get an error saying:

I0XZBTR.png

Never actually had the need to export to .jar, so I'm pretty much in the blank.

Edited by Visty
Link to comment
Share on other sites

30 minutes ago, Visty said:

So I'm trying to compile my classes using intellij's artifacts. However, when I go to Project Settings > Artifacts > Jar > From modules to dependencies  > Main Class > *MY CLASS*.

I get an error saying:

I0XZBTR.png

Never actually had the need to export to .jar, so I'm pretty much in the blank.

Just ignore that warning and press OK. Your jar will function fine.

Link to comment
Share on other sites

1 hour ago, Visty said:

So I'm trying to compile my classes using intellij's artifacts. However, when I go to Project Settings > Artifacts > Jar > From modules to dependencies  > Main Class > *MY CLASS*.

I get an error saying:

I0XZBTR.png

Never actually had the need to export to .jar, so I'm pretty much in the blank.

 

1 hour ago, HeyImJamie said:

Download Eclipse, Link folder - .Jar w/ that. I had to create an individual project each time to .Jar w/ IntelliJ

 

Here is how to do it:

1. Open module settings (F4), or right click on a module and select open module settings

2. Navigate to the artifacts tab on the left

IMGhbo7.png

3. Click the green + symbol and select JAR -> Empty

6hgzpgZ.png

4. Move the compiled output of the module you want to put into the .jar from the available elements (on the right) into the .jar (on the left) by double clicking on it

AXO8BQg.png

 

5. Set the name of your .jar, and change the output directory to the scripts folder:

JLTiUqt.png

 

6. Select apply.

7. To then build your script, in the navbar select Build -> Build Artifacts... -> Select the artifact you want to build

Edited by Explv
  • Like 3
Link to comment
Share on other sites

2 minutes ago, Visty said:

Doesn't this compile all the scripts in the packages inside Intellij into the .jar file? :o

No, it will only include what you tell it to include.

If you make each of your scripts it's own module, then you can include each individual module in a different .jar

Notice how I have one .jar for my AIO script and another for my walking script.

Edited by Explv
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...