jar

Loading a JAR dynamically from memory

邮差的信 提交于 2020-01-21 04:51:25
问题 I want to load a JAR dynamically, straight for memory. Say, I have a buffer that contains a JAR, and I want to load all the classes inside the JAR, or at least list all of the files that exist inside the JAR. (classes, images, etc...). What do I do if the first class that I load depends on the second class, for example? Does java know how to handle this? Or I have take care of this by myself? 回答1: Since you said “at least list all of the files that exist inside the JAR”, let’s begin with that

Maven Install plugin: parameter file is missing or invalid

瘦欲@ 提交于 2020-01-21 03:16:05
问题 I have a local jar and I want to use it in my project. There are plenty ways to do it: just install manually into local repo, do it with script in parent pom, use system scope, use local repo declaration. I decided to use Maven Install plugin to install jar into the repo. Here is a configuration: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <version>2.3.1</version> <executions> <execution> <phase>initialize</phase> <goals> <goal>install

How to insert version numbers in our java jars, that a user can access?

妖精的绣舞 提交于 2020-01-21 01:47:09
问题 We have a library that gets released with a different version number every couple of weeks. The problem is that in order to store the version number in our jars we have a version.txt file that just contains the version number and then gets included into the build. This seems like the wrong way to do this but I can't come up with a better solution. What is a better way to store the version number in our jar's so that if a user calls me up I can easily find out the version of our product they

Can't make JDBC connection to MySQL (using Java, IntelliJ, and Linux)

给你一囗甜甜゛ 提交于 2020-01-19 12:00:04
问题 I am having issues trying to get a database connection using the code below: try { Class.forName("com.mysql.jdbc.Driver"); Properties p = new Properties(); p.put("user", user_name); p.put("password", password); connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1/jsp_test", p); } catch (SQLException ex) { // handle any errors ex.printStackTrace(); System.out.println("SQLException: " + ex.getMessage()); System.out.println("SQLState: " + ex.getSQLState()); System.out.println(

Can't make JDBC connection to MySQL (using Java, IntelliJ, and Linux)

跟風遠走 提交于 2020-01-19 11:58:07
问题 I am having issues trying to get a database connection using the code below: try { Class.forName("com.mysql.jdbc.Driver"); Properties p = new Properties(); p.put("user", user_name); p.put("password", password); connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1/jsp_test", p); } catch (SQLException ex) { // handle any errors ex.printStackTrace(); System.out.println("SQLException: " + ex.getMessage()); System.out.println("SQLState: " + ex.getSQLState()); System.out.println(

Jar Mismatch Found 2 versions of android-support-v4.jar in the dependency list

ε祈祈猫儿з 提交于 2020-01-18 05:49:31
问题 I am trying to create 2 versions of an Android app (free/paid). I have an Android Library that contains files common to both. I created a new Android project and am trying to use the Library but get the error below: Found 2 versions of android-support-v4.jar in the dependency list, but not all the versions are identical (check is based on SHA-1 only at this time). All versions of the libraries must be the same at this time. Versions found are: Path: /Users/Zaheer/Developer/App Free/libs

How to start java program (from .jar) elevated only using VBScript

跟風遠走 提交于 2020-01-17 12:26:31
问题 There is a great answer providing a batch file what will allways do it's best to run elevated and will not elevate if already elevated. I don't want to distribute the batch file with my program though. The whole core of the answer is this VBSScript: Set UAC = CreateObject("Shell.Application") UAC.ShellExecute "[path to the batch file which will run elevated]", "ELEV", "", "runas", 1 Pretty simple. So just instead of the path to the batch file, I want to use the path to a jar file. But it

Is it possible to get IntelliJ IDEA to generate an executable JAR manifest like Eclipse does?

邮差的信 提交于 2020-01-17 08:18:30
问题 I've had to make some modifications to an old Java-based project which contains dependent JAR files in the project tree. When I last worked on this project 3 years ago, I was developing it in Eclipse and generating runnable JAR files using Eclipse's File -> Export... function, which worked great. When I started working on this project again I switched to using IDEA. Following online documentation I was able to create a runnable jar using IDEA's Project Structure -> Artifacts pane. However, I

creating our own jar and using it in another project

心不动则不痛 提交于 2020-01-17 07:56:50
问题 I want to create our own jar which has some simple methods like a print method. I created the jar of that java project and imported it into an other project I am building path also. The problem is that I am able to create the object of the classes which reside in the jar but I am unable to call the methods of that class. i am using eclipse 3.4 (Eclipse Ganymede (3.4))version 回答1: Sounds like if you are successfully building the JAR that you are not including it in the classpath when you

Run processbuilder and get in and output

≡放荡痞女 提交于 2020-01-17 04:33:05
问题 I'm trying to get my program to launch Enchanter to SSH into my server, but can't seem to figure out how to get in and output to go to stdin and stdout , or anywhere for that matter. I just get a blank output window in Netbeans. How to I get the Jar to run, and get input/output? public class openShell { public void openShell() throws IOException { String line; Scanner scan = new Scanner(System.in); ProcessBuilder builder = new ProcessBuilder ("C:\\Program Files\\Java\\lib\\enchanter-beanshell