Generate JAR File To Distribute Having Multiple Projects

Jan 20, 2015

I have an application separated into three different projects - core, command line version and Web UI version.

Core contains all the business logic in several services classes. Command line version and Web UI version both uses the core project services.

Command line have main class which call services from core. Web UI version is Spring base application using same services from core.

Java Code:

CoreProject
- src
- Service Classes (code here use thirdParty jars and core_file.txt)
- lib
- thirdParty.jar
- core_file.txt mh_sh_highlight_all('java');

[Code] ....

Now I want to give two separate versions to client.

Command line version to run as service in Windows andUI version to deploy in their server.

With above structure I create the cmdline.jar but when I am trying to run with

Java Code: java -jar cmdline.jar mh_sh_highlight_all('java');

I am getting java.lang.NoClassDefFoundError exception for the service classes in core. So my question is how to pack/generate jar for this kind of distribution?

View Replies


ADVERTISEMENT

How To Include Java File In All Projects

Mar 23, 2015

1) I have a file .java with some great functions, this functions i need use in all projects, then what is the easy by moment i start a project, and copy this file to project.. is possible have only 1 file with these utilities functions? (if yes how to declare or use in all projects?)

Note these utilities file i want use on JAVA desktop(swinf and javafx), on JSP webpages and in the futhurer on the mobile.
 
2) I have a JSP project in 1 .JSP file i have 8 Tabs (CSS tabs) when user click on tab1 i execute some jsp java code. and if user click on tab2 i execute a different JSP code, but my problem is, the JSP file is large large large, 1500 lines, my question is: is possible (similar in PHP) do an include?
 
<%
   include tab1.jsp
%>

View Replies View Related

I/O / Streams :: Generate File Tree Structure Of Mounted Unix File System

Apr 22, 2014

I am creating a web application that runs on server X(unix) and it has another unix system mounted on it. I want to generate the file tree structure of this mounted unix file system and show it on to a web application so that users can select a file and move it onto this current unix machine.

I know this sounds stupid and you may want to say why cant we directly copy the file, I am doing a proof of concept and using this as a basis.

View Replies View Related

EJB / EE :: Use Asynchronous Annotation In Distribute Environment

Jul 18, 2014

Can we use EJB @Asynchronous annotation in distribute environment. I know we can use it but I want to know its Advisable or not. Because It's not advisable to manage user thread in Distribute environment like EJB container .Earlier if we want to make Asyn call then we use JMS. But now they added @Asynchronous annotation with Future Class to achieve the same result.

View Replies View Related

Randomly Distribute People In Groups

Jan 18, 2014

I want to create a program that takes n number of people (String vector) and assigns them a random group number (int) the range from 1 to k. The number n is evenly divided by k.

I have created a program that associates every String with a random int number. There is however the problem that the random generator just gives a random number, but doesn't make an equal number of people for each group. Which means even if the numbers are random, some of the numbers happen to come up more times than others.

How can I write, to make sure that each number is generated the same amount of times?

View Replies View Related

Web Services :: How To Generate JAR File Given WSDL File

Mar 7, 2015

I have a given WSDL file (around 1MB) and inside of the file they have many request and response types.

I have to generate JAR from it so I could import it on my current project and use it

I have tried using this: [URL]....

but it only generated 1 stub file and a 1 callback handler java files and its size is around 60MB.

WHat I need to is to generate seperate class file per response / request type... Is there a way to do it?

View Replies View Related

Generate A File In Java With Unix TimeStamp

Feb 5, 2015

I need to generate a file in Java with Unix TimeStamp. Want to generate an ordered list of Data entry objects for a defined period of time e.g., getData (long startTimeStamp, endTimeStamp, long resolution).

1) I would like to generate resolution with random numbers by using Random class.

2) How to take Start and end timestamps to generate a file (i.e., writing into a file).

View Replies View Related

Swing/AWT/SWT :: How To Generate PDF File Of The Contents In AWT Frame

Sep 25, 2014

I have been doing a project of ERP solution using JAVA AWT FRAMES and MYSQL(for database purpose). Here there is an ADMIN portion, who has the authority to make PAYROLLS of individual employees. There is a Frame where individual employee details will be shown(like basic salary, HRA, no.of leaves, other allowances...etc) in text boxes.

Now what i want is to make a PDF file of that payroll, so that I can make a hardcopy of it. The idea is just like anyother online form fill-up, where at the end you submit and save (or export) as a PDF (or text file) document. But I mention that it is a stanalone project, not an online one (i think it doesn't matter though).

So the basic idea is how to make a PDF file by extracting the text field or choice contents from a frame in JAVA AWT.

View Replies View Related

JavaFX 2.0 :: How To Generate Import Tag In FXML File

Jul 16, 2014

Whenever I use a control inside an .fxml file like:
 
<Label></Label>, <TableView></TableView>, etcera ...
 
I get an exception for example:
 
Label is not a valid type., TableView is not a valid Type., etcera
 
This exception I then solve with placing an import tag inside the .fxml file.
 
However as I do not know each import name, I have to look this up like writing down:
 
Label label = new Label();
 
inside a class and then place my cursor on it to see which import name Eclipse generates.
 
This import name i then put inside the .fxml file with <? import ?> beginning and end tags with question marks around it.
 
Is there anyways to automatically generate these import tags inside an .fxml file even if you don't know the import name for the control you want to use?

View Replies View Related

Projects To Use Different Data Structures?

Oct 27, 2014

I'm finishing my data structures class and looking for internships and trying to prepare myself for real world application of things I've learned. I'm trying to figure out what sort of project I can start or start over winter break that would use the new data structures I've learned (BSTs, Heaps, Hash Tables, etc). We have been implementing these from scratch but would I be using a library for these on the job? If so, should I implement them that way instead? I have a registrar project from my first data structures class where I used a linked list and then an array list to take care of the different students, classes, and instructors. Maybe I should clean that up and just use that?

how these data structures can be used in non-trivial situations and why I should use one over another. I just don't know a good place to start.

View Replies View Related

Projects To Do While Reading Head First Java

Mar 24, 2015

I'm currently reading Head First Java and want to use the topics shown in the book while I read it to master them. What are some good projects that can be used to practice all the skills taught in the Head First Java book while I read it?

View Replies View Related

No Java Source Files In Projects?

Apr 10, 2014

my course material is due for term 1 of my cert 4 programming course, but My lecture will not pass my java projects because there is no source files generated for them in the net beans project structure, tried building, cleaning and building, all i can think of?, tried IDE's 7.4 and 8.0 .

View Replies View Related

Naming Projects In Eclipse (hierarchy)

Jan 27, 2014

Below I've attached a screenshot of how I've been naming my various java projects as I go through my current textbook. I'm not sure if I'm naming them correctly. I'm on chapter 5 of Introduction to Java Programming by Y. Daniel Liang and he is currently discussing methods and classes. I'm not sure what my projects would be considered (methods, classes, or something arbitrary like projects). Further, if I wrote a program, like loanCalculator215 for example, how could i call that in a different program, like primeNumbers?

View Replies View Related

NetBeans IDE - Naming Java Projects

Jun 22, 2014

The naming conventions for coding Java applications are clear to me. I'm  wondering what the best practices are for naming Java projects e.g. when creating a new project in NetBeans IDE or in BitBucket?

View Replies View Related

Using Multiple Classes In One File

Mar 1, 2015

I have recently start learning about objects and classes in java. I understand that in order to use multiple classes in one file you need one class to be public and the rest are private. But after that I don't understand how to invoke the private class in the public class. I thought if I tried programming on my own I can have a better understanding of it, but had no success.

View Replies View Related

Delete Multiple Lines From File?

May 21, 2014

I have a text file with the below details and we get the input as name CONNECTION_PORT and we need to delete the matching global variable which as CONNECTION_PORT and keep the remaining global variable in file without using any temp files.

for example

input:
CONNECTION_PORT

Text file

<globalVariable>
<name>CERTIFICATE_PASSWORD</name>
<value>fgfdgfgf</value>
<deploymentSettable>true</deploymentSettable>
<serviceSettable>false</serviceSettable>
<type>Password</type>
<modTime>1398834966045</modTime>

[code].....

View Replies View Related

Execute Data From Multiple CSV File

Jan 19, 2015

There are multiple .CSV files (each file has multiple rows and columns). I need to fetch data from all the files and find MEDIAN of the values for each column and do further calculations. Suppose there are 3 files, i need to find the MEDIAN of column 1 in file1, MEDIAN of column 1 in file2, MEDIAN of column 1 in file3. Below code just fetch data from one file.

package testdatapkg;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
 
[code]....

View Replies View Related

Multiple File Renaming Script

Nov 29, 2014

The following script is a multiple file renaming script. Once this script completes the renaming of multiple files the script then deselects all of the files it renames.

Any kind of jscript code that can allow this script to keep the renamed files highlighted after the renaming process is complete?

function OnInit(data){
data.name = "RenameBaseNameContinueNumbering";
data.desc = "";
data.copyright = "";
data.version = "1.0";
data.default_enable = false;
var cmd = data.AddCommand();

[Code] ....

View Replies View Related

Split Text File In Multiple Files

Jun 17, 2014

I have multiple text files that contain several docs. my files look like this:

<doc id 1> some text </doc>
<doc id 2> some more text</doc>
...

As output I want to extract the text between the tags and then write the text into several files like 1.txt, 2.txt ......

here is my code so far:

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

[Code] ....

I can not seem to get around how to print the text into several files.

View Replies View Related

Write Multiple Records To A File - Why Does This Keep Overwriting

Oct 27, 2014

So I am calling this method several times and trying to write multiple records to a file. Problem is that every time I call the method it overwrites the file from before and doesn't add it.

public void fileWriterMethod() throws IOException{
RandomAccessFile raf = new RandomAccessFile(filename, "rw");
raf.writeInt(id);
raf.writeInt(existingMileage);
raf.writeInt(gasCost);
raf.writeInt(ndays);
raf.writeInt(rate);

[Code] ....

View Replies View Related

File Input - Multiple Sets Of Data

May 5, 2014

I am trying to create a Community Theater program that has Actors, Directors, Investors, Staff etc. I should eventually be able to input the information for the people from both a file and the keyboard. I'm working on trying to take in multiple Actors from one file and adding them to an ArrayList of Actors. My code takes in only one actor right now.

I am trying to take in multiple sets of data for the same type of class but creating new instances after each set of data (16 lines). Each actor has 16 lines of data (text file included), so I was thinking that I would need perhaps a for loop but I am unsure of how and where to implement it. I am also unsure about adding these new actors to the Actor ArrayList. I'm a little shaky on the idea of creating multiple objects when it is unknown how many you need to create. Right now, I know how many Actors I need to add but it would be nice if I could learn how to expand that based on the user's needs.

My Questions:
How can I write my program to know when it is done reading 16 lines and then initialize a new Actor (will expand to other people)?(expanded below)Eventually, I plan on using my theaterObj (an instance of CommunityTheater class), what if I wanted to move the readActorFile method to that class? Would that change the way I implement anything majorly? Would it still be a static method? I ask this because I want the Actors array to be a variable in the CommunityTheater class. I would extend this to adding actors to an ArrayList in a Play class which would be in CommunityTheater as well. So, essentially a CommunityTheater has different Play(s), and each Play contains a list of Actors.

I don't exactly know where I should put a loop (should I use a loop?) to read through each line, in readActorFile or in readInFile? How should I write this loop, as in, how do tell my program what line it's reading?

for(countLine=0; countLine < 17; countLine++) or while(countLine<17)
read all the info
and then an if(?)-

if(file has a next line)-I don't really know how to code this-start over with loop of reading information?I don't know about the for loop, as I'm not sure how to "count" lines in a text file.OR I've been thinking that readInFile in the Actor class could return something(true/false?) to let the method readInActor know that it's done reading, then readInActor can check to see if there's anything else in the file, if there is- it would call the readInFile in Actor class again to read in information... and so on. But again I am unsure of how to code this.

View Replies View Related

Compiling Multiple Java File Using Terminal In Ubuntu 12.04

Feb 11, 2015

I am new in java. I executed a java program using eclipse. the program contain two java file. when i try to run it using terminal in Ubuntu. Two files are not linking. it shows error. i am attaching all the data.

It shows the following error

regex2string.java:83: error: cannot find symbol
str = randomstr.nextString(2000);
^
symbol: variable randomstr
location: class regex2string
1 error

[Code] ...

View Replies View Related

How To Write / Save Multiple Lines Of Text To SVG File

Jul 2, 2014

I am writing to a file coordinates of texts using PathIterator (Java Platform SE 7 ) saved as SVG format i defined the Font attributes using AttributedString (Java Platform SE 7 ) and TextLayout (Java Platform SE 8 ). It is saving to the file and working properly, but it is just writing as a single line of text where is my target is multiple lines of text, i began using LineBreakMeasurer (Java Platform SE 7 ) Class, but some text is removed plus i got single line of text only, where i face the problem that , How to determine the width to get multiple lines of text ? i tried to figure out from this exampleDrawing Multiple Lines of Text (The Java - Tutorials > 2D Graphics > Working with Text APIs) where is drawing multiple lines of text but i am using getBounds().getWidth() of TextLayout object the code i tried

View Replies View Related

JSF :: Execution Of File Upload Primefaces Multiple With Counter

Apr 16, 2015

I am not all secure on the execution of the fileupload Primefaces.

The uploading execution occurs normally, but I would like to have a counter that control's the received files. The problem is that sending files go by so fast by this method that appears to be running in parallel. My question is whether this behavior is normal while sending files.

If it is not, where may be the error. If it is normal what can i do to make the counter really take the right value?

I'm using the scope of the "bean" type of view, but when im trying to run the session the problem also occurs depending on the file size.

If my files are very small, the execution is very fast and I cant follow the counter. If I clean the code the execution usually occurs no matter the size of the files.

@ManagedBean (Name = "bean")
@ViewScoped
public class BeanUpload {
private int counter;
@PostConstruct
public void init () {
counter = 0;

[Code] .....

The result on the console for 3 files is:

COUNTER EX: 1
COUNTER EX: 1
COUNTER EX: 1

If I run the code in debug mode on the console this is the result:

COUNTER EX: 1
COUNTER EX: 2
COUNTER EX: 3

Versions: Mojarra 2.1. Primefaces 5.1.15

View Replies View Related

Java Code - Multiple Execution Of Jar File With Different Inputs

Jan 4, 2014

I would like to ask you how can i execute the next code without errors.

I am trying to execute a jar (myFile.jar) file multiple times with different inputs from another jar file. More simple i have game with many players and i create a Round Robin scheduling for the tournament, i need to execute all the mach's of a round together.

When i run the next code it execute on the first game with the first players multiple times.

Java Code:

public class RunJARFile {
//10 player
//5 game per round
public static void main(String[] args) throws IOException {
for (int Tour = 0; Tour < 9 ; Tour++) {
for (int Game = 0; Game < 5; Game++) {

[Code] ....

View Replies View Related

Write Out Multiple BufferedImages To Single TIFF File?

May 28, 2015

I need to write out multiple BufferedImages to a single tiff file. Each image represents a seismic time slice which can be several megabytes in size.  I have used the TIFFEncodeParam.setExtraImages method and saved all my BufferedImages to a vector but my since I create so many BIs I keep running out of memory. Is there a way to create a BI, write it out to a TIFF file, then discard the BI and create the next one?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved