I have a small application that I have been working on for several months. It works great. Now when I created an executable .jar file for it, it will not load data from a .csv file. I have tried looking into everything I can think if. I checked file paths, etc. I am using OpenCVS to read the csv. Is there an issue with that when you include it into another .jar file? I am trying to log if there is an error but I don't even get an error. I just doesn't run past that statement...
I made a project in eclipse and exported it with libraries into a jar file.
Now I need to obfuscate that jar file so it can't be reverse engineered or anything.
I just need something basic. Just where I put the jar file as input and it will output another jar file that is obfuscated.
I looked at proguard but it looks complex for something like this. I don't want to be spending ages making config files or anything... What I should use?
Embedding an executable .jar file on a webpage. I am not a programmer and we use Blackboard Publish to package our Blackboard sessions into a standalone executable .JAR file which gives the user the full Blackboard experience. We want to embed this file on our webpage, so I did some research and I understand I have to use a Japplet (?). I have tried putting the basic (J)applet code I found on the web (modified of course) onto the webpage (see code below) but I get a 'ClassNotFoundException' error. I don't have the ability to define the files that are in the .JAR created by Blackboard Publish. How I would go about embedding this file? I can look at the files within the .jar with Winzip but there seem to be loads of .class files and I am unclear which one my webpage is trying to find!
I have an executable jar file that I decompile using androchef. I have to use androchef otherwise I get to many errors especially with jd-gui. I need to know how to export the files after I have decompiled them with androchef so that I can edit a file then send to netbeans and rejar.
I'm trying to run a command line executable file using java but there is no output. On the task manager a conhost process opens when the application is run. I've tried
I am trying to uses classes from a non executable jar called noexec.jar in an executable jar called exec.jar. With no defined manifest in the nonexec jar and a manifest in the exec jar. The folder structure where the jars are held look like so.
ROOT /lib | ---nonexec.jar ---exec.jar
With the class path defined in the manifest for the executable jar as Class-Path: nonexec.jar . However every time I run java -jar exec.jar, I get Exception in thread "main" java.lang.NoClassDefFoundError: What even though I am including nonexec in my class path why the classes contained within the jar are not being found?
I am working on a project that requires me to build a database with random access file, representing products, the base product contains a name (about 30 characters), a price (double), and a quantity (integer). I have worked on this project for probably 15+ hours and have tried so many things and feel like I've barley made any progress...
The part i am really struggling with is taking the data from the text file and creating an object array with it using the product class. Once ive accomplished that, i have to use that data to create a random access file with the data.
Here is the base Product class that must be used to create the objects for the array.
public class Product { public String pName; public String stringName; public double price; public int quanity;
[Code] .....
And then here is the data from the text file that i must extract to use to create product objects.
These continue for about 40-50 entries, they are not separated by a blank line though i had to add those so it would display correctly, each entry is on its own line with name separated with spaces, then price after a comma, then quantity after the second comma.....
I am working on a project that requires me to build a database with random access file, representing products, the base product contains a name (about 30 characters), a price (double), and a quantity (integer). I have worked on this project for probably 15+ hours and have tried so many things and feel like I've barley made any progress...
The part i am really struggling with is taking the data from the text file and creating an object array with it using the product class. Once ive accomplished that, i have to use that data to create a random access file with the data. Here is the base Product class that must be used to create the objects for the array.
public class Product { public String pName; public String stringName; public double price; public int quanity;
[Code]...
these continue for about 40-50 entries, they are not seperated by a blank line though i had to add those so it would display correctly, each entry is on its own line with name seperated with spaces, then price after a comma, then quanity after the second comma.....
I am working on a project that requires me to build a database with random access file, representing products, the base product contains a name (about 30 characters), a price (double), and a quantity (integer). I have worked on this project for probably 15+ hours and have tried so many things and feel like I've barley made any progress...
The part i am really struggling with is taking the data from the text file and creating an object array with it using the product class. Once ive accomplished that, i have to use that data to create a random access file with the data.
Here is the base Product class that must be used to create the objects for the array.
public class Product { public String pName; public String stringName; public double price; public int quanity; //Constructor public Product( String pName, double price, int quanity )
[code]....
and then here is the data from the text file that i must extract to use to create product objects.
Dill Seed,938,34
Mustard Seed,100,64
Coriander Powder,924,18
Turmeric,836,80
Cinnamon (Ground Korintje),951,10
Cinnamon (Ground) Xtra Hi Oil (2x),614,31
Cinnamon (Ground) High Oil (1X),682,19
these continue for about 40-50 entries, they are not separated by a blank line though i had to add those so it would display correctly, each entry is on its own line with name separated with spaces, then price after a comma, then quanity after the second comma.....
I need to write a program that will create an inventory file as a random access file. The problem that I am having is that among the things I need to add to the random access file is a "car name". Since random access files are byte based I don't know how I could possibly write and then read a string value.
I'm given a task to generate an API (a jar file) where the access of a certain database is provided through the API. basic functionality: Client sends a query through the API to server and the Server responds with data.Since its and API, do I have to implement the code or is it enough if i gave just interfaces? what are the OOP concepts to focus on when designing a good API.
I am having hard time to grasp the concept of java as i am beginner. according to different sources found in internet, only one class is written in one source file. and all those class can be accessed through the main class. my question is
1.can we access one class present in one source file, through another class present in another source file [not through the class containing main method]?
2.can we create more than 1 class in same source file?is there special way to do it? i do get error always when i try to do so 3.can multiple classes contain main method? or should there be only single class containing it?
I want to access variable of java file into jsp Page. So I tried to do this but it does not work.
Problem : when I am trying to access "getName" method of java class into jsp file it displaying error, i already imported "Ajaxmethod.java" file in to "success.jsp" I want to access "getName" method in to jsp file without creating object of class.
Ajaxmethod.java package a.b; public class Ajaxmethod implements Action{ public String name; public String getName() { return name; }
I'm trying to access class file which is inside the package and package is inside the jar file but I can't access that class file inside my source file . All files are on desktop .
I have a random access file stream. I have below code I want to written data that is currently pointed by pointer till the end and display that data on System.out Stream but it is not working my code is
//Create a Random Access File java.io.RandomAccessFile random=new java.io.RandomAccessFile("D:/input.txt","rw"); //Position the pointer to a seek try { random.seek(300); long pointer=random.getFilePointer(); System.out.println("Current Pointer is:"+pointer); int a; while((a=random.read())!=-1) { System.out.println(a); }
Where am I wrong? Although it is returning actual position of pointer in pointer using
I am creating a read/write, RandomAccessFile that I will use to store several student ID and gpa score. What I don't understand is how I should go about retrieving a particular set of data.
public class ReadWrite { static Scanner keyboard = new Scanner(System.in); static String fileName = "Stu.dat"; static RandomAccessFile raf; public static void main(String [] args) throws FileNotFoundException, IOException {
I'm trying to save a picture from byte arrays using RandomAccessFile. The file appears but doesn't open (like its corrupted).
I'm using the bittorent protocol which gives a SHA-1 hash that I compare all the bytes with to verify the data. All the bytes pass the hash check and all the hashes are checked. So I'm pretty sure I'm getting all the bytes correctly.
Is there anything I can do that could tell what's going wrong?
public RUBTClient(final TorrentInfo2 tInfo, final String outFileName) { ... this.outFileName = outFileName; File destined = new File(outFileName); try { destined_file = new RandomAccessFile(destined, "rw"); destined_file.setLength(tInfo.file_length); } catch (FileNotFoundException e1) {
I'm trying to write data for three products to a random access file, but I have a problem. Each product has a code and a price. After writing them to my file, I want to get to the second field or product. I do this by getting the length for each record, and multiplying it by the field number I want to go to. I use the result for the seek() method of the RandomAccessFile object. It is giving me an EOFException, but when I use 0 for the seek method i get the data for the first poduct or field.
Java Code:
public static void main(String[] args) { final int RECORD_LENGTH = 16; try(RandomAccessFile productsOutput = new RandomAccessFile("C:UsersalfonsoDesktopBinaryTestRandom.ran", "rw")) { String[] codes = {"java", "jsps", "txtp"}; double[] prices = {49.5, 19.9, 29.9}; for(int i = 0; i < codes.length; i++) {
I am working on a card game and for lack of better terms, have royally screwed up my files. I do still have an executable jar that I would like to go back to if possible and try to redo what I messed up. What I was able to do was to use WinRAR and get ?encrypted? class files. Something that is obviously not editable. How can I go about converting these back to editable java files, if possible?
I am new to JAVA. I need to execute a program, based on the OS. If I am on Mac, the program is a .x and if It is on Windows the program is .exe. The program also requires a line of commands attached to it (i.e. relap5.(x) or (exe) -i inputFile -o outputFile -r restartFile -s stripFile
Here is my coding
String in = " -i ", tfIntdta.getText(); String rst = " -r ", tfRstplt.getText(); String out = " -o ", tfOutdta.getText(); String strp = " -s ", tfStpdta.getText(); if tfStpdta.contains(".csv") String run = in, rst, out, strp; else String run = in. rst, out; // I want to execute either a .x file or .exe file, depending on if I am // running the app on windows or mac run relap5.(x) or (exe) (string run goes here)
when I am programming let say in VB using Visual Studio, finally I build .exe file that can be run on all Windows by double click.For Java I am using Eclipse and to run those apps I am using run from Eclipse.How I can create a sort of "executable" for my Java app that I would be able to run it by file click on Windows or Linux?