| |

VerySource

 Forgot password?
 Register
Search
Author: xenon1

How to call an unpackaged class under a packaged class

  [Copy link]

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-29 00:45:01
| Show all posts
You can also put it into a jar package and put it under the extension directory of jdk.
Let the extension class loader load your class directly.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-29 06:00:01
| Show all posts
Learn from everyone upstairs!
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-29 06:15:02
| Show all posts
[Quote=Quote the reply of 4999999484 on the 3rd floor:]
Yes, try a jar package
[/Quote]
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-29 07:00:01
| Show all posts
Bale
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-29 08:00:01
| Show all posts
Top six

Enter the current path under dos and execute the following command

jar cvf classes.jar one.class two.class three.class

Import the generated classes.jar file into the path
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-29 08:30:01
| Show all posts
Come and learn, hehe!!!!!
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-29 08:45:01
| Show all posts
Learning is coming, huh
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 LAN

Post time: 2020-8-29 09:00:02
| Show all posts
The master has said it :)
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-8-29 09:15:02
| Show all posts
One of the solutions is to edit the class-path and add the package
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-29 09:30:01
| Show all posts
You can try to change your classpass path, in the environment variable,
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list